diff --git a/sync-for-expenses/.speakeasy/gen.lock b/sync-for-expenses/.speakeasy/gen.lock deleted file mode 100755 index f4f674c13..000000000 --- a/sync-for-expenses/.speakeasy/gen.lock +++ /dev/null @@ -1,4856 +0,0 @@ -lockVersion: 2.0.0 -id: db99c2c9-4c7c-4123-9b4e-591ea4fb8649 -management: - docChecksum: 30019a7a4b59fe2bee4f34a5b4a56669 - docVersion: prealpha - speakeasyVersion: 1.761.5 - generationVersion: 2.879.13 - releaseVersion: 7.1.1 - configChecksum: 4b15ec17ab003f1984652c5fd94ee308 - repoURL: https://github.com/codatio/client-sdk-typescript.git - repoSubDirectory: sync-for-expenses - installationURL: https://github.com/codatio/client-sdk-typescript - published: true -persistentEdits: - generation_id: 65a6773d-a06b-49a4-8015-c48d567399dc - pristine_commit_hash: 7b05c90b4c0bc73e60b9d369f2dd85be973007f8 - pristine_tree_hash: 03db22a5328e7cb5c88888650d606018c287c667 -features: - typescript: - additionalDependencies: 0.1.0 - constsAndDefaults: 0.1.14 - core: 3.26.48 - decimal: 0.1.2 - defaultEnabledRetries: 0.1.0 - deprecations: 2.81.1 - enumUnions: 0.1.0 - envVarSecurityUsage: 0.1.2 - examples: 2.82.5 - globalSecurity: 2.82.16 - globalSecurityCallbacks: 0.1.0 - globalSecurityFlattening: 0.1.1 - globalServerURLs: 2.83.1 - methodArguments: 0.1.2 - nameOverrides: 2.81.4 - nullables: 0.1.1 - responseFormat: 0.3.0 - retries: 2.83.0 - sdkHooks: 0.4.0 - serverEventsSentinels: 0.1.0 - uploadStreams: 0.1.1 - webhooks: 1.5.1 -trackedFiles: - .gitattributes: - id: 24139dae6567 - last_write_checksum: sha1:26d16d8297b104945139da8c25bd38feeaad3e25 - pristine_git_object: 113eead5093c17d43a46159132885318f281a68a - .npmignore: - id: aa70c1f807c3 - last_write_checksum: sha1:6572da81f2e7a978ec29c22c2210bf461c5897b2 - pristine_git_object: 670ac0a62d7e568c9d44a14f5deafb8442a255d8 - FUNCTIONS.md: - id: 21b9df02aaeb - last_write_checksum: sha1:2f8b25d26a01c0f4018a251664cdb1ac70768d20 - pristine_git_object: 5fe8f2c17fba803ff4cd7fdd4181b3ce44137884 - RUNTIMES.md: - id: 620c490847b6 - last_write_checksum: sha1:e45b854f02c357cbcfdb8c3663000e8339e16505 - pristine_git_object: 27731c3b5ace66bedc454ed5acbe15075aacd3dc - USAGE.md: - id: 3aed33ce6e6f - last_write_checksum: sha1:6e3f5fdc68e19c3f66ee787bf960d5bceaacc7f9 - pristine_git_object: f7d004f5791e9b942f9ffbf35bec838e972bc5e0 - docs/lib/utils/retryconfig.md: - id: 0ce9707cb848 - last_write_checksum: sha1:bc4454e196fcd219f5a78da690375a884f5ed07b - pristine_git_object: 08f95f4552349360b2c0b01802aa71ec3a55d2c2 - docs/sdk/models/errors/errormessage.md: - id: 9affd825e395 - last_write_checksum: sha1:8a78a55a9626c5ef2079259cd8971c4ef7544a3a - pristine_git_object: 3e89159c2619ac94bfa3d84a9f352922d4b916a0 - docs/sdk/models/operations/createaccountrequest.md: - id: db311ac2227e - last_write_checksum: sha1:83164a5aa752412a3d0178cd4a3b9cb169108028 - pristine_git_object: 27b0dab276b2378d76af94952445f515412ee59e - docs/sdk/models/operations/createadjustmenttransactionrequest.md: - id: c3a30a33547a - last_write_checksum: sha1:1015f12015db0500841696c5b870ee011c9a30f9 - pristine_git_object: 54b394d040980a2412b59e3e5b6e09626f739505 - docs/sdk/models/operations/createbankaccountrequest.md: - id: 37b65b9ee948 - last_write_checksum: sha1:5db97ffff65b591b746b9f5aa23acc17bb7256bc - pristine_git_object: e4a966d6762f6b1c3c0e9c8a6ab6157c4dc14d47 - docs/sdk/models/operations/createconnectionrequest.md: - id: 43b13768fa3c - last_write_checksum: sha1:7afa123cc313d80bc68294231e1e2695853e3479 - pristine_git_object: b4131fdf4f4b3d5e13faec6459f829cad67f9c53 - docs/sdk/models/operations/createconnectionrequestbody.md: - id: cd2a86f8a996 - last_write_checksum: sha1:db18e94fc09476688b410f26f2dffb97f4e5ad5c - pristine_git_object: 2905789d14539b4a0a9348630275d97985cb13a6 - docs/sdk/models/operations/createcustomerrequest.md: - id: a69e49094dee - last_write_checksum: sha1:cbfc7ec1ed3c567b3a49d437879c18e6382152cb - pristine_git_object: a128fffd99f905ea5736fcef4f4bd0b47a0b0b24 - docs/sdk/models/operations/createexpensetransactionrequest.md: - id: dd727553911f - last_write_checksum: sha1:93ed85145963e17271d98e4073824965bb5f881b - pristine_git_object: 8f18821dded805dd9af1bd09e002c1fbe221bcf3 - docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md: - id: 42e50c2a4fe4 - last_write_checksum: sha1:39b8157d47f5339a755995737fbe97c23458c9b3 - pristine_git_object: b1c1be5bee1168a3b90c67c2aef3acb9441435a1 - docs/sdk/models/operations/createreimbursableexpensetransactionrequest.md: - id: cd5616f06263 - last_write_checksum: sha1:9bc02ea20043a90dfe5e5f41c04be11cec2c91aa - pristine_git_object: af3df215bddb413f0001d0bd33e459d0c44b79f2 - docs/sdk/models/operations/createsupplierrequest.md: - id: ae6f827978a1 - last_write_checksum: sha1:674d789d00022c28a8b6b5dc52bff1b73bed56bb - pristine_git_object: f6ca363080249a94f64baa00e2aeeabbc83e62d7 - docs/sdk/models/operations/createtransfertransactionrequest.md: - id: 217b753097ec - last_write_checksum: sha1:f208718fe2840cc2b3a03e4bd50196e09a1d6bd0 - pristine_git_object: c931c53321b0c9070f8b4dd6ce45368fa11808c2 - docs/sdk/models/operations/deletecompanyrequest.md: - id: 01348357e18f - last_write_checksum: sha1:27cfd7bc354091298276444b8c7bcd5cf4956af0 - pristine_git_object: a7c499d90f29a226314d2d522810d8670ffec084 - docs/sdk/models/operations/deleteconnectionrequest.md: - id: 70fe5fee5d10 - last_write_checksum: sha1:f0b888ca9bff2b5cf324dc7441110382c4a1bd96 - pristine_git_object: 3bdb93d2879d96acd67315a25003654b6bd52810 - docs/sdk/models/operations/getcompanyconfigurationrequest.md: - id: ced9b4ed0a7f - last_write_checksum: sha1:a3f40b9b68da262a1ba34186ddf1c35bc2bc0b0f - pristine_git_object: 1b6830504c7eeae0e31e9d831cfe7df18c023949 - docs/sdk/models/operations/getcompanyinforequest.md: - id: 5b3108df97d4 - last_write_checksum: sha1:f735c28cbbd3bcb24fdf6d765a1b82d5560654ff - pristine_git_object: 5dcdfd81f24b8097be378545bbadc1817ddeb27a - docs/sdk/models/operations/getcompanyrequest.md: - id: cb14d531f942 - last_write_checksum: sha1:8dfb6a8751e0fd595de115d757231ee367043f44 - pristine_git_object: dc098ef998b6f05e508eb8ba9f84e3b5c4fd7153 - docs/sdk/models/operations/getconnectionrequest.md: - id: 6545321b6497 - last_write_checksum: sha1:838bd028fae4be985b9bf4a810929a028f4be857 - pristine_git_object: 4479cf98b6cc8eb76121803c68745234f03bbfc0 - docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md: - id: 0e4ec0ad05f3 - last_write_checksum: sha1:b1162342ac862f8b951d0a1233e2889ffa54fa43 - pristine_git_object: 2bb1328eb7711adcfce02f61d3640c7669c35e8a - docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md: - id: 66e8596350bf - last_write_checksum: sha1:2dbc8492e351577ea59533850198b16faa7b0266 - pristine_git_object: a65ef72787e4200be099a47cfa34d3d960590b41 - docs/sdk/models/operations/getcustomerrequest.md: - id: edafb6bf96c4 - last_write_checksum: sha1:bc47703114a5d2cbb3cd8d041dcabf62e3df8b49 - pristine_git_object: 87bae75373abc2f5027a4dc4203e38de13a9b2e5 - docs/sdk/models/operations/getdatastatusdatastatuses.md: - id: 4f0c9aaee44b - last_write_checksum: sha1:9ca526362a5a239ad1729e673afd1cb0f3f6021d - pristine_git_object: e12b6f6632c83e6025c52b8c2e14a4e3da890ad8 - docs/sdk/models/operations/getdatastatusrequest.md: - id: 5734357a58fc - last_write_checksum: sha1:9792e21a16e6bff7d3483963e80136c8b7d31a01 - pristine_git_object: f9a15f355a7c16e376477e78334235eae50de568 - docs/sdk/models/operations/getlastsuccessfulsyncrequest.md: - id: c1e78a2d5a75 - last_write_checksum: sha1:0d18f2bdd002b41c9e0e8e9653746a4ab2858b11 - pristine_git_object: d9a3a8b77b522a648e0625cee82cf0ea8a323726 - docs/sdk/models/operations/getlatestsyncrequest.md: - id: 5c189b027c58 - last_write_checksum: sha1:4993be496d209b0682888ed15da4efa47b570a36 - pristine_git_object: dd432ec9814af652882f829253939fb1917c0bba - docs/sdk/models/operations/getmappingoptionsrequest.md: - id: 7d26d2f1e731 - last_write_checksum: sha1:50f36d26143323deffc66b32fc429a43a6b2cfbd - pristine_git_object: 43ecd008593eda3727a554b05524883bcc8506ec - docs/sdk/models/operations/getpulloperationrequest.md: - id: 6d02e8f040db - last_write_checksum: sha1:0e9f6530b698531cc14b4d375bf5d08641bdd324 - pristine_git_object: e8be4affae6d280fde5fb69a40e040c9c41e0a90 - docs/sdk/models/operations/getpushoperationrequest.md: - id: a2a83a8acbf9 - last_write_checksum: sha1:27267b9ae93c864c920748edf3f9978199fead87 - pristine_git_object: 36492fcc30a19cfaa4e892dc6e8f42f417efea8d - docs/sdk/models/operations/getsupplierrequest.md: - id: 7bff526bb864 - last_write_checksum: sha1:03abc7188d0e03ff885fff58562441f98e7854ed - pristine_git_object: 0496c3d26f53be218ac251e0d0e3944a86943b57 - docs/sdk/models/operations/getsyncbyidrequest.md: - id: a2b85abdc53f - last_write_checksum: sha1:41998738ae3f1f01dbcc709b3d1331643e0f6640 - pristine_git_object: 2af028b0df46b15ca0d72937f8319783ec6a93a3 - docs/sdk/models/operations/getsynctransactionrequest.md: - id: 61f1f3dcd6de - last_write_checksum: sha1:3032063e7883c6a6dbedd899063c4b65c629761e - pristine_git_object: 8a9bea2af9b8b0223b3e905709d0b3f8fb96a406 - docs/sdk/models/operations/listcompaniesrequest.md: - id: 605dcf27a33d - last_write_checksum: sha1:26392767927a7c5bc257b7274e4e96d5e9771f8d - pristine_git_object: 75a1acdf86f3499603b51bf7ce0f87c1e404ea99 - docs/sdk/models/operations/listconnectionsrequest.md: - id: 6b2aa79356a9 - last_write_checksum: sha1:fc076d0c550a616df3c37712b93dda5e1ec87484 - pristine_git_object: 34da692d50c2e2e7094e216aecd66be40dc59445 - docs/sdk/models/operations/listcustomersrequest.md: - id: ca10f7a6aa5c - last_write_checksum: sha1:af9a925b6777eba8dada97a3ca53baeccae654ef - pristine_git_object: f803f4ef718a73bf5dd9b211be396dc590ce1c0c - docs/sdk/models/operations/listpulloperationsrequest.md: - id: d91fce013be3 - last_write_checksum: sha1:2650ec1347f347efb1b0b55b345e673a09765659 - pristine_git_object: b94d5fe2f31304ad742a8dffa953f290c34ebf94 - docs/sdk/models/operations/listpushoperationsrequest.md: - id: c2d50d99d272 - last_write_checksum: sha1:0ae03844f63445ea957acce740d1a54687ab06f4 - pristine_git_object: fc45f4aac3fc7207b16aab58fccf19921f6435d3 - docs/sdk/models/operations/listsuppliersrequest.md: - id: 32a966d4f6d7 - last_write_checksum: sha1:ffc0eccd0085ba30e93409f94a44d7d312d758c1 - pristine_git_object: 77f29b496aa80b016b9cb58055f8ea9549457e4b - docs/sdk/models/operations/listsyncsrequest.md: - id: 8cce29edcbeb - last_write_checksum: sha1:0da84eb37d38d72e643435f9b12af223e3073e36 - pristine_git_object: e7795c50abf653a9e7742b5a0527e11612241836 - docs/sdk/models/operations/listsynctransactionsrequest.md: - id: ff58dbaa4772 - last_write_checksum: sha1:3d2cb720a255817aaf58c04aaf49249cc0293286 - pristine_git_object: 68662c906a00470b9c4e09db2e38b9d6db6f35ea - docs/sdk/models/operations/refreshalldatatypesrequest.md: - id: c4d9aab31ee7 - last_write_checksum: sha1:3cc35cbedcdaee56a8b308ece2d8054c23a22597 - pristine_git_object: b89b2938cf7b4a59b5598c94bc4bd04544e6671b - docs/sdk/models/operations/refreshdatatyperequest.md: - id: e47fb457a374 - last_write_checksum: sha1:e344443a40b11f584e922b96e1908025175c7642 - pristine_git_object: 13c8bf6a4863e86446de3c4d35114a624e85da17 - docs/sdk/models/operations/replacecompanyrequest.md: - id: 2f79da54c18c - last_write_checksum: sha1:9e39848d3486075911dd7c453a56f50e4fd7e593 - pristine_git_object: 39a5f1615abbdb0abb6dfdad59a2e673e32a0ab1 - docs/sdk/models/operations/setcompanyconfigurationrequest.md: - id: e6a6ec124086 - last_write_checksum: sha1:63addaee259834fdf6818c63e43c5e32f8565ec7 - pristine_git_object: 08215ca9535af6e4989d0eb0e04abe105a161416 - docs/sdk/models/operations/unlinkconnectionrequest.md: - id: 9f3addbe3925 - last_write_checksum: sha1:d502454a001169442628a18036e3ad2974a9dc21 - pristine_git_object: 13e769eb4e4b8c6f52a0f95bbcb9ff0b79aa2aa9 - docs/sdk/models/operations/unlinkconnectionupdateconnection.md: - id: 454c96f5ba2d - last_write_checksum: sha1:027c8a21295614dec328672db78f127f1d0ee5c0 - pristine_git_object: 31e24da54b47b69689d6e170358cfe179da06c76 - docs/sdk/models/operations/updatecompanyrequest.md: - id: 6501e66b32d2 - last_write_checksum: sha1:3825dc8684bb12d1057d1af9eeab8543f5550847 - pristine_git_object: f7f4e0ce7a405b0e95edb05471775f2c0d4c2885 - docs/sdk/models/operations/updatecustomerrequest.md: - id: 12bf67fd6cac - last_write_checksum: sha1:2c3047aa8d2a1da1b210d55b862ed0e960c2d108 - pristine_git_object: 44258e0e3ed8183b946ebdd6bcef24130adfcec7 - docs/sdk/models/operations/updateexpensetransactionrequest.md: - id: b27b44512267 - last_write_checksum: sha1:5d5fc6c9a2bfd9437a08e1bf5a2c2e917a6023e0 - pristine_git_object: 1cd159b1793d776b1f1bb54d9f200536b9d5bf55 - docs/sdk/models/operations/updatereimbursableexpensetransactionrequest.md: - id: f4fdf80ad8a8 - last_write_checksum: sha1:a757b1ac18a1b4f58cb87a3c2249ca654f27c2cf - pristine_git_object: 46b059d4e472a4a46d1559b2149dfeca68b2331d - docs/sdk/models/operations/updatesupplierrequest.md: - id: 1f70a198fbdf - last_write_checksum: sha1:5ca5666180f1d78aa55fb90ee4c998838e7b4ca5 - pristine_git_object: e9f5b954809c594a74db87fbe77f71ed00e33b7a - docs/sdk/models/operations/uploadexpenseattachmentrequest.md: - id: 66dc665704d7 - last_write_checksum: sha1:d772e8e91772eb7d9e471d929643c4c9937a29df - pristine_git_object: e208b8b736c0489e101383e07ed0af29655e181d - docs/sdk/models/shared/accountingaccount.md: - id: bb60e4c3dd9d - last_write_checksum: sha1:5c1164eba52052c82e86a5ea7f5f8d6817f3e268 - pristine_git_object: 4e964b870d34f682f673e6c363f68766de2ce50f - docs/sdk/models/shared/accountingaddress.md: - id: 3964ba07ab0f - last_write_checksum: sha1:eb2eeb38bc9bfe3f78b88b2079f85f7384a8816f - pristine_git_object: dcd6f23b71decaff842ab24c9912128fbf52157e - docs/sdk/models/shared/accountingaddresstype.md: - id: 9a69f5fe6f07 - last_write_checksum: sha1:6d90da9f881d5a16ff6ba3574e8b9d1d59e0683a - pristine_git_object: 329f374d823ef9b12046a77807a6d5da5f67be7b - docs/sdk/models/shared/accountingbankaccount.md: - id: 35bbd90bb6b9 - last_write_checksum: sha1:77c6b9676d43d638e9b5b7dd7e6beed725fa3162 - pristine_git_object: 060a3e9cfd3c66fcad569059fc713d6b370fb49d - docs/sdk/models/shared/accountingcustomer.md: - id: cc9bd80c804b - last_write_checksum: sha1:88e687104f768ebb0668900c3f76975c9fe78548 - pristine_git_object: 65cf569e8f3fecbfebde506338d9ab4763907e93 - docs/sdk/models/shared/accountingsupplier.md: - id: 641d9aede215 - last_write_checksum: sha1:df8d99cfc9a5f3754d2c6fc598c129de4f58def5 - pristine_git_object: a4a8675ee2caff5cc93ef7325c7e9c38594059c7 - docs/sdk/models/shared/accountmappinginfo.md: - id: d9e3190979a2 - last_write_checksum: sha1:3d60823645c3904d6f740e473a7f84a1215ff15c - pristine_git_object: a3ba74ac76c9041592cd67b7b6d02c2dc5d78a9a - docs/sdk/models/shared/accountmappinginfoaccounttype.md: - id: b2ca2fce0414 - last_write_checksum: sha1:732f850570fea89a41c28c27364820fcb5a61305 - pristine_git_object: 3f6674836e7008180553ecc0c74b7fa4dd7a7536 - docs/sdk/models/shared/accountprototype.md: - id: 8552719629cb - last_write_checksum: sha1:b78714fb10ccbfa7ce0c875e7a392fc20c694f55 - pristine_git_object: 0e92b9eca9dcda92c3eb8d71337f1a78f6b660e6 - docs/sdk/models/shared/accountreference.md: - id: 58428b661587 - last_write_checksum: sha1:7079cf6e4596face312d240957ec0e571053171e - pristine_git_object: c23a324e21088d668739785a6140abc8426fb1b4 - docs/sdk/models/shared/accountstatus.md: - id: a8da19baff08 - last_write_checksum: sha1:74efa97740311033c4e66522e28f796ee6017498 - pristine_git_object: dcf16a7ae9774f8c80b8ae506b4072befd9f460e - docs/sdk/models/shared/accounttype.md: - id: 1c016d1deade - last_write_checksum: sha1:ab70310eca5b76ab9905d05c5eba606f79d81f1a - pristine_git_object: 7c160556e0a24e8371434aeccf692dc7cf1cb6ac - docs/sdk/models/shared/adjustmenttransactionline.md: - id: ddb509a1b7ac - last_write_checksum: sha1:f672733c658fd52d9e0a603950cb26d19672d978 - pristine_git_object: e7b048d634190c45cfb7d0b84e5f834ac0297f66 - docs/sdk/models/shared/adjustmenttransactionrequest.md: - id: 4eba922fb1dc - last_write_checksum: sha1:b5c632097e74525993002877668844c453f27c16 - pristine_git_object: 9a51d7d46d0e2331807f9820e98834a201aa37ec - docs/sdk/models/shared/adjustmenttransactionresponse.md: - id: dfac84202376 - last_write_checksum: sha1:609f49928ff37a85133cf033e6cd0414507bc917 - pristine_git_object: cbb13947e3af8cbf8b13c27f9dee0f869866d5a8 - docs/sdk/models/shared/apaccountref.md: - id: 8516b225919f - last_write_checksum: sha1:707ff795524f0d801295ecf35f27065eaf4286db - pristine_git_object: dc0b26bd178812912e88b21fa921da46c7ab2c72 - docs/sdk/models/shared/attachment.md: - id: 36725df2d249 - last_write_checksum: sha1:5d885c0da20bd5f2d15daf50aeb453ca26aef952 - pristine_git_object: b4a8ddd602739f4a27ede9f08e43fd29a014b8d1 - docs/sdk/models/shared/attachmentupload.md: - id: d5b29912ce98 - last_write_checksum: sha1:036adade458b937511e8dd1cad816c13c65531d9 - pristine_git_object: 83587492993db1e17150669307e2a579271e1bc7 - docs/sdk/models/shared/bankaccount.md: - id: a71ab3d0bf48 - last_write_checksum: sha1:727e5ab413d86808c8948d4bcfc10bfe8f2770b8 - pristine_git_object: 271d7b9f64c89bbad486520850187b924a9a3646 - docs/sdk/models/shared/bankaccountdetails.md: - id: 6c5e922b55b6 - last_write_checksum: sha1:2cd58aa895356c8802355245b1105eda7aff00e5 - pristine_git_object: ce07f9f39238cffd1c4f8d99f774e15da14fe1a0 - docs/sdk/models/shared/bankaccountreference.md: - id: 76d37dffe8f1 - last_write_checksum: sha1:af6dced8210746f40adf650dde8f1526a5bac36f - pristine_git_object: f816304a208f756b1235af4e43625e8fe7116b05 - docs/sdk/models/shared/bankaccountstatus.md: - id: bb5d0730c110 - last_write_checksum: sha1:79aaeea2dca8eb019e273a5eefbee8208bd2bb18 - pristine_git_object: b3f48e4196aaef304f92be93d55f1d1deb6f41c1 - docs/sdk/models/shared/bankaccounttype.md: - id: c1d73962c4ab - last_write_checksum: sha1:4e9749a9df89554e752d3bf6027547cf7600f784 - pristine_git_object: 06fd8ef7778271c33e931abac707583fb0b017b8 - docs/sdk/models/shared/clientratelimitwebhook.md: - id: 2ad187176bc8 - last_write_checksum: sha1:573f4cacdb8f5f798ab5cc6af27bf99f60c1407d - pristine_git_object: f7b31736e107948c1accbe5e66d85fdfadee1b72 - docs/sdk/models/shared/clientratelimitwebhookpayload.md: - id: 455bfe8fe625 - last_write_checksum: sha1:55f949ea0daf452a977f09af105e1edd66e17405 - pristine_git_object: b2e4e808d588fc5bd7f169e0032640c6e275821a - docs/sdk/models/shared/codatfile.md: - id: b32544e3a5a3 - last_write_checksum: sha1:dd726f3342d6a51b42287ccccd9b24862f1e5fdf - pristine_git_object: 992373efbf1acfb59845881463c16ab88bacd20f - docs/sdk/models/shared/companies.md: - id: d934c193ecb6 - last_write_checksum: sha1:d3f0ef331bdbbdb37d7cc6b6a9ef2c0b8ac2054a - pristine_git_object: 6c3aad5c00d9d3d8ddd978e99e285e0f10e6a190 - docs/sdk/models/shared/company.md: - id: fb5206b144df - last_write_checksum: sha1:13ef9972bebfae5d2d3d57ebfa7336facbcbbe31 - pristine_git_object: cd71b8f877a7cff3200eb2da7bde68024c5433d2 - docs/sdk/models/shared/companyconfiguration.md: - id: c4c1d029ff3d - last_write_checksum: sha1:edd49468ce3b38509f83c809c53948512c44113e - pristine_git_object: 0c3c170f72ee8ef7ec7fbcaeeaa304ba18b8a983 - docs/sdk/models/shared/companyinformation.md: - id: d78b0b4b325a - last_write_checksum: sha1:d87db98d8a478508e8eefc5b95d16920e18ed60b - pristine_git_object: ca591ec430574c3cb180999a97265c06f4c028c2 - docs/sdk/models/shared/companyinformationphonenumberstype.md: - id: 5f6b258b79a6 - last_write_checksum: sha1:df1b8fed79a874de04d60bd5b98cb4fdce8a8512 - pristine_git_object: d3d67cf979961e3e9ea4b64018da70f258c5de26 - docs/sdk/models/shared/companyinformationtype.md: - id: 963eace7a313 - last_write_checksum: sha1:d5111467a3c19932085078af5062c961138a0d06 - pristine_git_object: aff62fba01135c29ce5fbc72f850566c488c80c1 - docs/sdk/models/shared/companyreference.md: - id: eb83cae3df56 - last_write_checksum: sha1:a4e935ba8aa07fbf8a5c782add8083adb1065c55 - pristine_git_object: 75a856b2420bd1f1380ae47922742a4a1d86b59d - docs/sdk/models/shared/companyreferencelinks.md: - id: bdd0ee48a65d - last_write_checksum: sha1:538851bc2f7cc686ac53bd2c63cda7d44f1e3659 - pristine_git_object: 5d3c7889a3a3e8287a5690df8383a18915707003 - docs/sdk/models/shared/companyrequestbody.md: - id: 3f3dfd0aa865 - last_write_checksum: sha1:882d83423205127fa4b428883840cdfc2a415e9e - pristine_git_object: 1f7dc8ab105cb7f145df2c4f54f9ada43e855a4e - docs/sdk/models/shared/companysyncstatus.md: - id: ff34830a4405 - last_write_checksum: sha1:3468e400ab3e6f30398e6c4ea3b59c1757e94ee1 - pristine_git_object: babb4dbd831f76b849e4cad2a3042340d07a38cd - docs/sdk/models/shared/companyupdaterequest.md: - id: cef525a660f4 - last_write_checksum: sha1:8260c54339551aa570d7af7c408ee2f54d151dd8 - pristine_git_object: 53f4afb62fc92e3e5e8ece429318c5e509885275 - docs/sdk/models/shared/connection.md: - id: 1c171381dd82 - last_write_checksum: sha1:6d75a4c5d58f1d64c5372a44563309c22ba6c106 - pristine_git_object: 5992f0e7c0ce2d1427c83fe5cee885bfc4632f71 - docs/sdk/models/shared/connections.md: - id: c39072f6f8dc - last_write_checksum: sha1:2237c241be5bd605d28691378482c6018ddd82e4 - pristine_git_object: 7660dd1cbc46fb0c01b855848b0fe3dbd26883de - docs/sdk/models/shared/contact.md: - id: e5934fdccf44 - last_write_checksum: sha1:6d6a14c74b687aa2e4e1f4e1481a33f868481b95 - pristine_git_object: f286d1cd0245bbfeb2237ccb23213b06b84164de - docs/sdk/models/shared/createaccountresponse.md: - id: 22d3c5961ed4 - last_write_checksum: sha1:7fe996f7c8bf3321c0032b2b2835682ab0927250 - pristine_git_object: b0420917dd36544e8be7d6ba9d5a145ffdfc38f2 - docs/sdk/models/shared/createaccountresponsemetadata.md: - id: d0d7ea926d42 - last_write_checksum: sha1:62a10c6208a14da74010ed6e4d653d2a315392ad - pristine_git_object: 09974cb785cc3ec684a8f2634882e5929ee1abe0 - docs/sdk/models/shared/createaccountresponsevaliddatatypelinks.md: - id: dfa2b04dcb36 - last_write_checksum: sha1:34b546425e43825c1e87d134f87974d2f7041567 - pristine_git_object: 00318b7e2f3c9b589dfcf74bd337e0cd3a94e34c - docs/sdk/models/shared/createbankaccountresponse.md: - id: 4683db5f43bc - last_write_checksum: sha1:7c206818ca47e75f64e39fae22559dea9631a71d - pristine_git_object: 7205d6bae9e55db7b51346073c2160f5525694b5 - docs/sdk/models/shared/createbankaccountresponsebankaccounttype.md: - id: e15c674001f0 - last_write_checksum: sha1:00e012aa0a77e3cf18fd99b0cb3e0ce3a63fe585 - pristine_git_object: 1b4c93f6180ba875bbc181eaaca63bb57594b1c6 - docs/sdk/models/shared/createcustomerresponse.md: - id: 1c74d5b7c8ba - last_write_checksum: sha1:e484709fd7c37eea7240d994c328e9aab74b2d84 - pristine_git_object: 9839b28b70347b863d424ff0e60b456f479a8b1b - docs/sdk/models/shared/createexpenseresponse.md: - id: 139e2fe718e5 - last_write_checksum: sha1:87d24a292b4aabdbbb550b10b5e98e74e315de64 - pristine_git_object: d6e45144f0fc864c06871386c762df0896d66cb1 - docs/sdk/models/shared/createreimbursableexpenseresponse.md: - id: 1688f14d5dd6 - last_write_checksum: sha1:c9bc98bb0f9c583b87066b244e505c9076c4ee1a - pristine_git_object: c6e99671e2c6c12f6c4802506d5d2626ffb4386d - docs/sdk/models/shared/createsupplierresponse.md: - id: 570bb3b8fced - last_write_checksum: sha1:ef749758bfd687ca49c74acc7e5b16c641d8cd3e - pristine_git_object: 463bbad393f0a4db2f848697b60cb61a257a629e - docs/sdk/models/shared/customer.md: - id: dcca51c7af48 - last_write_checksum: sha1:a8829552cb537926d17e16aeec28e21cf7010c1f - pristine_git_object: 18c747e2bb2bc198b51cb7589f7a539600dbb473 - docs/sdk/models/shared/customerdetails.md: - id: dbac8c3914b7 - last_write_checksum: sha1:bf18afff4283bf2ae5b338d3d2a1cf4eb0c20ddb - pristine_git_object: 3ad932471e27d749f56d1fc24c1a9b12f23e70ec - docs/sdk/models/shared/customers.md: - id: 9f3e26bb4101 - last_write_checksum: sha1:8bf223fec03d035c355690acaf4a6ee4543db8b5 - pristine_git_object: 1027cef144c4eb06acb91255952cd77cbd1459b4 - docs/sdk/models/shared/customerstatus.md: - id: cee6ce30ff25 - last_write_checksum: sha1:03a75d8623d5102ddc41121ba24fb36eae6ae9b4 - pristine_git_object: d58f3bb08d3a7b776f1cd9a49349c3198189b04a - docs/sdk/models/shared/dataconnectionerror.md: - id: 993cf6eb3364 - last_write_checksum: sha1:b3a75cf4c02efef713063a04fcf52d0a4956d8e0 - pristine_git_object: d61074d99d1fad75ec8bbc6630caf3b325dac646 - docs/sdk/models/shared/dataconnectionstatus.md: - id: fd14e3dc6ca5 - last_write_checksum: sha1:35c5cc26adb05b147de723522ed736691577f5c6 - pristine_git_object: cb907c67176f9a8e4e9494257e8cbc9ce9f69cf6 - docs/sdk/models/shared/datasetstatus.md: - id: 13ee7a38a328 - last_write_checksum: sha1:79d92a6b0352a57b16d40d3bbd4b6094df6a191d - pristine_git_object: 7969d33163c68cc8412ec8189d9816777de8a5c2 - docs/sdk/models/shared/datastatus.md: - id: cb4795d3f294 - last_write_checksum: sha1:9d079e81c22fce43e34e143722f527280dac4450 - pristine_git_object: 23cfe858a73bd0c77b20dd6e1a6742948935d422 - docs/sdk/models/shared/datatype.md: - id: 0338d85c906d - last_write_checksum: sha1:e8545e68e0db6f58d6d15d329591cb53ebc4694d - pristine_git_object: de4a6935d79f2c7c25f06f0ce20169b05a47d0ea - docs/sdk/models/shared/datatypes.md: - id: 673024637a09 - last_write_checksum: sha1:a7209db9947d51be6d91fefc46b3b5f3f0b8f795 - pristine_git_object: 551a8b937dc2860dd2d2b2d04a84104445060833 - docs/sdk/models/shared/definitiontransaction.md: - id: c10a91f68283 - last_write_checksum: sha1:77664cbbe85f52435e706ede36d77f3d0ffed23c - pristine_git_object: 906e07b824b06919aca6d544f92ac28094e19673 - docs/sdk/models/shared/errorstatus.md: - id: d836c01e48c6 - last_write_checksum: sha1:0225cc635c3a3759e3a3c4ae3bda2f6e915776c0 - pristine_git_object: 4fb4cb0ffb17acc2bf16f1375c7afd706b64b78c - docs/sdk/models/shared/errorvalidation.md: - id: a1197fba13d0 - last_write_checksum: sha1:f79cc696b29be728148c8d3b95528e776161752d - pristine_git_object: 23c0ea69b9a0ba38a3dbb717785c00f33a92cb60 - docs/sdk/models/shared/errorvalidationitem.md: - id: dbec2a990008 - last_write_checksum: sha1:ed75f4ef8207a821c60c21d9746863b07e8d22c4 - pristine_git_object: 2629f578afb95e2fce63bce51bc90df23579f380 - docs/sdk/models/shared/expensecontactref.md: - id: 3320633fecaf - last_write_checksum: sha1:45460f7bbc83021c8573c7bbd06a28c662c06c92 - pristine_git_object: 482ec9a63b273ce29f376d5ac3db13898b1a00d2 - docs/sdk/models/shared/expensecontactreftype.md: - id: f28a4d6675c9 - last_write_checksum: sha1:2fb4372734a921e9bef4230bce18053507c67298 - pristine_git_object: c86ea87a9ad3344b1e3b7f61a1264f16183ada39 - docs/sdk/models/shared/expensessyncwebhook.md: - id: 5e2fdf197bbe - last_write_checksum: sha1:2fd7d5382fc3656b2fd150f4e65d9a7a27bce142 - pristine_git_object: 6ad92027535605be0bce933e46db6cabab37718d - docs/sdk/models/shared/expensessyncwebhookpayload.md: - id: b94133310d4d - last_write_checksum: sha1:04886acfb55b6031fbcb6e72e34860257d0731c5 - pristine_git_object: f50b74cb2aea04a04a017308f0ee8eb539329cfd - docs/sdk/models/shared/expensetransaction.md: - id: 2166a2d62ad7 - last_write_checksum: sha1:9b53617cdd7ff5bfd086eef9c63ce00a5aac0035 - pristine_git_object: 3cc7436d3b5ff8239308e32be9ffd759d01af12e - docs/sdk/models/shared/expensetransactionline.md: - id: 545d7857fb2c - last_write_checksum: sha1:fb1af7c16378504687edb23215582b5fdd194cfc - pristine_git_object: 483a5a4fb5d51c3719df57e705ea0f356a37f7fb - docs/sdk/models/shared/from.md: - id: aa600a5b57fd - last_write_checksum: sha1:862f917b2a4ff4c38ffb604f91f6c0adbdf53a57 - pristine_git_object: 02c04adb22408af1f0bc1acef77132fdacd19b41 - docs/sdk/models/shared/halref.md: - id: 140248af964e - last_write_checksum: sha1:4652b095a55e64ea41b883548918001e85bbbaec - pristine_git_object: 776eeb4da11328631a6025e6b0ece78533415782 - docs/sdk/models/shared/integrationtype.md: - id: 16b92f851b4d - last_write_checksum: sha1:725124b8bd0063cdfc9843a145c565b73eeb926d - pristine_git_object: 10dbd0e521b6d115098491581f829bfb808dd610 - docs/sdk/models/shared/invoiceto.md: - id: 9efb0eaa1096 - last_write_checksum: sha1:d9707200971d9d5ce097531ac3744cf629caea37 - pristine_git_object: f9b695f1be04e2cfe2e577c23764142a1581d7e1 - docs/sdk/models/shared/invoicetotype.md: - id: 30753670f277 - last_write_checksum: sha1:e6280c8ca48bb8a7fd2cf61c669e47916dc0d031 - pristine_git_object: 208ce82722c28b52b8220b2fd7f291a02b878709 - docs/sdk/models/shared/itemref.md: - id: 23c7408988fc - last_write_checksum: sha1:f66b7e3d563661b4d3c8580452b32c9342ccfdc5 - pristine_git_object: 49ca6cd52f80a4688d2dcb59ba79b5e0dc81f85d - docs/sdk/models/shared/items.md: - id: d1b7d7f548ee - last_write_checksum: sha1:9f39c7122093f42ba6d24506f87b5a26f7536cd8 - pristine_git_object: 3fd970a9f3c970edf18225414a9a37a41ac28e5c - docs/sdk/models/shared/itemstype.md: - id: ad67b7f3c086 - last_write_checksum: sha1:d28873e930f8a9d5136ee9086ecf7d533ba093b5 - pristine_git_object: a29cdee3c7494eb821a7d9a3c7a051f93ea89ab5 - docs/sdk/models/shared/links.md: - id: fa66a5b5f260 - last_write_checksum: sha1:6ae24fe5a1123376ad9fc97b70590bdbddc005e3 - pristine_git_object: d6a06ed470ddd660c15ba0b59056d3b35dbcadd9 - docs/sdk/models/shared/mappingoptions.md: - id: f944dc83ca30 - last_write_checksum: sha1:556d20c3f716210ac1bc4570ef1697388208f88e - pristine_git_object: ac6605cbc9cefd353a13e4b2648ecb216674739b - docs/sdk/models/shared/metadata.md: - id: d5813bbccd6a - last_write_checksum: sha1:10eb996c13ef342f7e37b008241b88820b5dba05 - pristine_git_object: 3bef2fb297a991338124e3270c3093b7126f09ce - docs/sdk/models/shared/phone.md: - id: ae03d66b667c - last_write_checksum: sha1:057a92d58ca4bcadb2c442a9015267898b0aee94 - pristine_git_object: 0a84604d88b6a9d3d3dc5fdc4fc25bf3be66e1a6 - docs/sdk/models/shared/phonenumberitems.md: - id: 215cf130f394 - last_write_checksum: sha1:28afceb74de150761b19ee87c2a2b01d81ece365 - pristine_git_object: b1cb36981183d77b945ea677d3c16c0687c7d0f1 - docs/sdk/models/shared/propertiedatatype.md: - id: d607368df9f0 - last_write_checksum: sha1:fce1a3b3674e40e0ca68395e823b5f981f1d1d29 - pristine_git_object: ad3472a4f323109538cc7849405231baee8f1bfc - docs/sdk/models/shared/pulloperation.md: - id: dcbd4e59dc15 - last_write_checksum: sha1:bdc4c4a508fca846e99eccd1a3c3cc681080ab19 - pristine_git_object: e5e1041dfc15148c932d02f27cbda619456500ec - docs/sdk/models/shared/pulloperations.md: - id: d7ead2cdeffc - last_write_checksum: sha1:c8b59670c42d7dbcad6db4e7925052bb4c8271c9 - pristine_git_object: 86e3f36f181393a0d5a01de6d34ab3d37fa03aec - docs/sdk/models/shared/pushchangetype.md: - id: 53824528b4ac - last_write_checksum: sha1:48ddf036c3f8eba1a7c74639964389338b233714 - pristine_git_object: 8da3b17886ed5d6680bf0bd5fa1d413b02e21c1a - docs/sdk/models/shared/pushfieldvalidation.md: - id: be50fc267930 - last_write_checksum: sha1:5de9fd7b48f96220f204a2b5409e2321ce36e5be - pristine_git_object: 92276f33c926d8cfc813586cb02caa17d915a005 - docs/sdk/models/shared/pushoperation.md: - id: 862ef21ffa69 - last_write_checksum: sha1:155fba79b29b2731070f8e566f6fb8a48d401a07 - pristine_git_object: 6acec032a9083f224e9b31fb0d96f1e97c8aa538 - docs/sdk/models/shared/pushoperationchange.md: - id: be046171d3af - last_write_checksum: sha1:b6927c0a089961cf90cc30b9ce890f050b79b56b - pristine_git_object: 2e005605ab12dd3cf4179706ccde1de20c69e36e - docs/sdk/models/shared/pushoperationref.md: - id: 41359c8937dc - last_write_checksum: sha1:600520f10e3f69975b684d737fa8191f22555807 - pristine_git_object: fd9b5005f966cbd174b77dbf45ffa4ad65700b01 - docs/sdk/models/shared/pushoperations.md: - id: 7efd8c6374e2 - last_write_checksum: sha1:b161bfda5689a167b2d235c27555027699f784a1 - pristine_git_object: 46c771d73744748c75e3c3506be3d6202c225cde - docs/sdk/models/shared/pushoperationstatus.md: - id: c01cab5bc311 - last_write_checksum: sha1:16d0a9a459791f783f7b863dcd9fef0eb10ec3fb - pristine_git_object: 6ccddbb04f5f9b1f4a30ff38a1d0ec78fec7648c - docs/sdk/models/shared/pushoption.md: - id: 28a9b11a0d39 - last_write_checksum: sha1:351b4f130ae38cd4558820bbd2b851c48b3a9454 - pristine_git_object: a450a2463a14839061afd6d1245437ddffbf8a91 - docs/sdk/models/shared/pushoptionchoice.md: - id: 3dc25ab7bea6 - last_write_checksum: sha1:519638eaabe620bd70a21bfb51140077a63808fd - pristine_git_object: caa4e330c11cfd5a367dfe5528522c4e17d6845b - docs/sdk/models/shared/pushoptionproperty.md: - id: 06f73d448642 - last_write_checksum: sha1:6eb365bf03ed030cedb5fac0b31c14398af1f028 - pristine_git_object: 6595312ababa73de75f4953b9b0e4c8f7337993c - docs/sdk/models/shared/pushoptiontype.md: - id: cc1fc9e23267 - last_write_checksum: sha1:0d07c3f9fa1d7f45e0b1104569aaac10ab68a822 - pristine_git_object: 0d88fa194b793b65f95de0bdcb90ec541e9321c8 - docs/sdk/models/shared/pushvalidationinfo.md: - id: 10ddca1b4793 - last_write_checksum: sha1:b75196afc1cf13ef84b048253b306fea6aa1bf8b - pristine_git_object: 0f083ff27e660e1f28cdd44e03dff99acc399af8 - docs/sdk/models/shared/recordref.md: - id: abf3fb72c244 - last_write_checksum: sha1:83d84252f8a04a91a4966872bbf32fe0f482b913 - pristine_git_object: 5d8883827a84efdb9c1273045419ed5deed4eb6a - docs/sdk/models/shared/reimbursableexpensetransaction.md: - id: 6fa2fa691e14 - last_write_checksum: sha1:a5224693aabf3ac59f12a3133b4f9858bfb5d68a - pristine_git_object: ec64c9002a78608334f7ec7ef3bb6f320985e549 - docs/sdk/models/shared/reimbursableexpensetransactionline.md: - id: 5776c8b1c16a - last_write_checksum: sha1:bfb4d95821b66cce5059fa1bdab989f0c88935da - pristine_git_object: 19c0bf57f0935034e4e4607efb403451266f2044 - docs/sdk/models/shared/reimbursementcontactref.md: - id: a58a9405e6a8 - last_write_checksum: sha1:e8697e1b915c67ccbaf2f9904cbd8ecaec838fdf - pristine_git_object: 8b0335819d2bf321f95f44a1930f33b9b0c49b96 - docs/sdk/models/shared/security.md: - id: 972729c50a07 - last_write_checksum: sha1:7aee923b806144dc5167b4f1966a309bf86952cd - pristine_git_object: 6d43c572235c19b3ce87ffaba804528b9ae6ed77 - docs/sdk/models/shared/sourcetype.md: - id: 3ec91bdaf5e7 - last_write_checksum: sha1:4d6a76486a04ddf203b81aee5902325430fcbd41 - pristine_git_object: 2a5853885f409e4d3664790ad0ca25713464952d - docs/sdk/models/shared/status.md: - id: d40dc096aca1 - last_write_checksum: sha1:86278d19ea08deb754724007ac9071536489689f - pristine_git_object: 4fbf01b4347448a1178dc9e0afd405c59c00ff9f - docs/sdk/models/shared/supplementaldata.md: - id: 0cbf04657884 - last_write_checksum: sha1:fd1c50042ec0bba59d6d5588c4321cf681d3e1e2 - pristine_git_object: 7455ae71a7bdfe86c4a67445dfd220764ca58a4c - docs/sdk/models/shared/supplier.md: - id: 18b82dd2f554 - last_write_checksum: sha1:d52d58cf7611b5c257b75b4aafbbb81e085e4a63 - pristine_git_object: 31b15ef0cb8d2953065d66920e3125f20b8abc99 - docs/sdk/models/shared/supplierdetails.md: - id: 62d782037f74 - last_write_checksum: sha1:7847cebc4a30a0b888aa90f4f50af47952a13a2f - pristine_git_object: 796fce9ed35f18fcd81b389a8dd99166a4e5cd69 - docs/sdk/models/shared/suppliers.md: - id: 09016bddb305 - last_write_checksum: sha1:72fb3da7feb33d53ae2248e3307ace74e0778f5a - pristine_git_object: fc580274903634e5ffd5284a895af115241704dd - docs/sdk/models/shared/supplierstatus.md: - id: 51c838d3b574 - last_write_checksum: sha1:4151a4fcc4ecc789cdb3928305ef26f89f15c428 - pristine_git_object: bae8b941d3768a6911cd82339805bee7f748a12f - docs/sdk/models/shared/taxratemappinginfo.md: - id: a9eb5e4a6aea - last_write_checksum: sha1:bbd27b8b7e6662147e2d725a5803a9e5c7fec09d - pristine_git_object: 25cab7e7fb55efcb3c266b4d3a9c4adc122e75d7 - docs/sdk/models/shared/to.md: - id: b5bd1a94620b - last_write_checksum: sha1:c3864e9370f79e4c12af5aa3f4328fa8bb577117 - pristine_git_object: be0c84690b2debfe1a3d760482e6edb5c05f06c4 - docs/sdk/models/shared/trackingcategorymappinginfo.md: - id: 500096775c8a - last_write_checksum: sha1:4ec07312ddd91aff67fa0a1c820a6f1383761ed6 - pristine_git_object: 8cee33eb1f3123dea92c227574ba305949b7dfbc - docs/sdk/models/shared/trackingref.md: - id: 3fc50d3208ff - last_write_checksum: sha1:d481cb95249b25a1dc3d9096aacc5e0eb08a71ea - pristine_git_object: 0b7429518cf9df72ec48d9b1671690271fc85743 - docs/sdk/models/shared/trackingrefadjustmenttransaction.md: - id: abaf558902fc - last_write_checksum: sha1:0457533166c138233fc96bb4a487419f3d4703e4 - pristine_git_object: 085c0d045f3a71030b31c65968235e69fe0cbd2d - docs/sdk/models/shared/trackingrefadjustmenttransactiondatatype.md: - id: 711bcbacb20a - last_write_checksum: sha1:aebe539770511609daf50fdd4da8d12e61719192 - pristine_git_object: fe7e0c69b16363477e45baf1513fbb47c0094db9 - docs/sdk/models/shared/trackingrefdatatype.md: - id: 1da75ca66097 - last_write_checksum: sha1:139ba26026e5000061a91adaa80220afc3fc830b - pristine_git_object: 0b507a10af5903ca634ae9ba1eed2b3065bd698f - docs/sdk/models/shared/transaction.md: - id: b2dd70b588f2 - last_write_checksum: sha1:bcbe66d4132b549d0617dd21b107c55801b9c85b - pristine_git_object: eef052c21a6746bf2ea3f0f88307516cd7a09cba - docs/sdk/models/shared/transactions.md: - id: 79e7a423b83b - last_write_checksum: sha1:b2d52b1dcd3fea7c46e86f81f9878f18a08caa54 - pristine_git_object: 13da35818a91dfb7d9ff23c9ea26d38074e0c96b - docs/sdk/models/shared/transactionstatus.md: - id: 29aed495b050 - last_write_checksum: sha1:dbf9f2a7c6f3cd460feab9c8f3d99f70b4579b0d - pristine_git_object: ce14a19117dd749c1571cd999f907160b8843e57 - docs/sdk/models/shared/transactionstatus1.md: - id: ea66964d5e64 - last_write_checksum: sha1:4913808b6e697d8b6f43557ddf32f704f9b671d1 - pristine_git_object: b988f771fab536d1af9ba3b90ad1db47977ad12d - docs/sdk/models/shared/transfertransactionrequest.md: - id: 9c2758632d9a - last_write_checksum: sha1:d7d1457daff9e97df83a0521d9c13927110bcd5c - pristine_git_object: 2a745159e9fbb1937418418dfef2a3b7f1216f32 - docs/sdk/models/shared/transfertransactionrequestaccountreference.md: - id: ae7a0b08a360 - last_write_checksum: sha1:cf1ac5a04f27f416588e8874274a959e673661bb - pristine_git_object: d58253c959a41c4d52bb58f663f8180dc32f8f4b - docs/sdk/models/shared/transfertransactionresponse.md: - id: 4374c2969cb4 - last_write_checksum: sha1:97f8d2523cb02c4a8ef00a885d7876374eda5575 - pristine_git_object: 34706236c43ad939040146d2526130ee52eb995c - docs/sdk/models/shared/type.md: - id: 04645f7284d8 - last_write_checksum: sha1:befdff645d8bd9fc46524ea1d360759f4e3b9ee1 - pristine_git_object: b39ccc35697451db7d6455591315855d3c009ed4 - docs/sdk/models/shared/updatecustomerresponse.md: - id: 9b1001138366 - last_write_checksum: sha1:81e40f0abf13665e9deb2f812100e6c0bd6843dc - pristine_git_object: e4ed8307b97304ab13748c469eba8385d91bdcd5 - docs/sdk/models/shared/updatecustomerresponseaccountingcustomer.md: - id: 5a35493b3dd1 - last_write_checksum: sha1:309638d65b97357123c71302e2dcd7441cbfb938 - pristine_git_object: 72325ddee1381070a579375cd9549610db0d7760 - docs/sdk/models/shared/updateexpenserequest.md: - id: 387f866c8495 - last_write_checksum: sha1:ac3d5f2fe25cee8afc46b8c6027c55fbe3177fc0 - pristine_git_object: 5025fc726a6012e8b322be794610ed22ae8227f8 - docs/sdk/models/shared/updateexpenserequestbankaccountreference.md: - id: 8515ad6cb7b5 - last_write_checksum: sha1:6825b4e17749d3b83887b5192dbe66bdba4ae34e - pristine_git_object: 53dd6c2941064a7eeee3eeadf972983967d5c49c - docs/sdk/models/shared/updateexpenserequesttype.md: - id: b3b8f4ba77a0 - last_write_checksum: sha1:e288d4ea784c60c1dc18fe10775e93bb87d25f4b - pristine_git_object: e669a7456ec784707c5e6f6cab53d48a3247e3ad - docs/sdk/models/shared/updateexpenseresponse.md: - id: 6f416c172c62 - last_write_checksum: sha1:284a7efbb88550180db9868dfbc07be4fc8ed7a3 - pristine_git_object: 50f783cc34df1ce4a9e2ff92744d49f2a047b1e5 - docs/sdk/models/shared/updatereimbursableexpensetransactionrequest.md: - id: 80cfacfe3446 - last_write_checksum: sha1:7ab87ab0acc7ddbcac4bacc4317249b77e1f1277 - pristine_git_object: 322eb58b7e2ebdae40833db07d4b39166ba66e2f - docs/sdk/models/shared/updatesupplierresponse.md: - id: 0f65a9ccdc8c - last_write_checksum: sha1:629599ecd1dff35add4dad0be48ca64d850a1a34 - pristine_git_object: 2f9eab7adc61a810e93c8a714bc119d21196d70f - docs/sdk/models/shared/updatesupplierresponseaccountingsupplier.md: - id: 21c70f3038a8 - last_write_checksum: sha1:0ea7b62508ca1dfad7fa29bf1e5ec71a3998c3ce - pristine_git_object: 548a8113e51220c2232bbc2cf47ce5746a3be7a6 - docs/sdk/models/shared/validation.md: - id: b9ffd70ca98d - last_write_checksum: sha1:326acba6a6b8c8fec33963cb9c8f62c15a48b9b6 - pristine_git_object: 1c46277412f046f8ad342504f136f4b4ff537560 - docs/sdk/models/shared/validationitem.md: - id: 4e3848a26890 - last_write_checksum: sha1:75d9d18dfbc5911a8f94d0c2e6d342adaa719fa6 - pristine_git_object: 1f16ed7a88513e312409023c32ca95ce37c950ed - docs/sdk/models/shared/validdatatypelinks.md: - id: 914dfac5a982 - last_write_checksum: sha1:282e555b87b469baa990c95b7e43a4ec9c778a35 - pristine_git_object: 0649c091bf1329568692129dd938b34333c4809e - docs/sdk/models/shared/validfor.md: - id: 36daaba2034a - last_write_checksum: sha1:571d8b409d1bf805a39f01b5cb0fc19521ffa59b - pristine_git_object: e0a384b870930a4ee8fd41c01f7ad66598ce4a61 - docs/sdk/models/shared/validtransactiontypes.md: - id: b3cc1a375891 - last_write_checksum: sha1:271aae388300b7342242b97aaa6395589defa76a - pristine_git_object: fd9faf538585c032d43230a22bf68878a4468d50 - docs/sdk/models/shared/weblink.md: - id: f69de72356af - last_write_checksum: sha1:6fff8feaebb23237caf3be75250aa1a0714baa20 - pristine_git_object: 6ab614a2a9929234396007817215f98a2d88d5e2 - docs/sdks/accounts/README.md: - id: d6c754b1ca96 - last_write_checksum: sha1:6398a2a9b65747a28fd8089771a854ebc733d372 - pristine_git_object: 1efcbdfc8700af1ca68505f846168404d29f84ca - docs/sdks/adjustments/README.md: - id: e7bc3bb1d249 - last_write_checksum: sha1:ae719682ae4c8194bad8400bcdde5adabb3256ac - pristine_git_object: 4abaf777bf55264729eb37540eac06b1590af926 - docs/sdks/attachments/README.md: - id: b60e6ecf628b - last_write_checksum: sha1:0843938f8fbe4e39e68ff655255af5db91397e8c - pristine_git_object: 773d8870dd09e7a51c4008fa9c5b8ee803167d2b - docs/sdks/bankaccounts/README.md: - id: 510ffee224ea - last_write_checksum: sha1:cd816c66bf8e50ab349f024fcda36e73dbbe3a5a - pristine_git_object: fd3842220748e2165a2c6f2d4b5f8a2ecb62ffa0 - docs/sdks/companies/README.md: - id: 67e8a49afa67 - last_write_checksum: sha1:ae8862268a345c488ed057101d1b9ab0b69b792d - pristine_git_object: 45ba7d15f687351d98ab2b9440d74c672bb16654 - docs/sdks/companyinfo/README.md: - id: 198b84d5c0c5 - last_write_checksum: sha1:e3d36b67a562ba8c967f60db5efca8af3118090e - pristine_git_object: 6e17588f1862e5e34c3f1f3d4a642113d7c60ac4 - docs/sdks/configuration/README.md: - id: d3a07ea941dd - last_write_checksum: sha1:251bbf34e6725b862bda6d96a4d33f935a024b1b - pristine_git_object: 4cf27ac47f924c8c71c251f47cdc6df2aaebe288 - docs/sdks/connections/README.md: - id: 3ef8931411ea - last_write_checksum: sha1:202734a1bb1320ce4ae610566fbc5ed7cbaa3cc8 - pristine_git_object: 4fd88fa711dbce59ea53afec2e29b58d9cae07d8 - docs/sdks/customers/README.md: - id: 9332759cffc2 - last_write_checksum: sha1:b14aa8b1cb650e255fc352d1cc54aa769c3e3d7f - pristine_git_object: 08faa564522bfeafcc11cbe40db2869b10e0a605 - docs/sdks/expenses/README.md: - id: 5692d1aab79d - last_write_checksum: sha1:3c01bd7a18b5d41a7e72d7971e47416600fcda73 - pristine_git_object: 884bbe4f74fe5f0738e04bc69abe97263842dcbe - docs/sdks/managedata/README.md: - id: 5fccd800fae5 - last_write_checksum: sha1:09b04f184a4591236ae247fc6607a9f7146b5759 - pristine_git_object: 6d2c36771b8ac18c00c85911de661f71cb8a229b - docs/sdks/mappingoptions/README.md: - id: 05c1205f046b - last_write_checksum: sha1:c5b40a20b2fb90b180eb2249aa6ee95dd6541ffc - pristine_git_object: 6a5f6047e07dfabf5351951662cf8b23c4d2e33a - docs/sdks/pushoperations/README.md: - id: 5f0b3f80f615 - last_write_checksum: sha1:ee711962e0b2c21540e336bcac0e9442d1aca289 - pristine_git_object: d6ecb414cb3966fbdae332dedfd6174510316890 - docs/sdks/reimbursements/README.md: - id: a5d637dcab67 - last_write_checksum: sha1:337dba8f86a6c0a99aa8d78367fb5e473d23af52 - pristine_git_object: b9fe2d56e33744ca47e33f6ba5c625d6424d80af - docs/sdks/suppliers/README.md: - id: 85867190cd79 - last_write_checksum: sha1:aaf02bdaf7172464636fcdb90e5780e5184fd214 - pristine_git_object: 72498acb832ac71787b72e58065f6f2aed395a27 - docs/sdks/sync/README.md: - id: a2e09f86bd16 - last_write_checksum: sha1:e08cd80b4911eb590a74fa67c869db3a6afdbfd9 - pristine_git_object: 98c55ce0578d73c40d2483328d6f31e209503b60 - docs/sdks/transactionstatus/README.md: - id: c3d24e0bf8e7 - last_write_checksum: sha1:0dad0d914641c5109fcb553ce382e83bf2738388 - pristine_git_object: 05eb6e943b39d77ef35dafaaba0520e3b3c19950 - docs/sdks/transfers/README.md: - id: f56918861798 - last_write_checksum: sha1:cee206b96689a806542143cc5c09406346ae0491 - pristine_git_object: 40a9011b4f258e1b6b0239a35cc2c5273af13aa4 - eslint.config.mjs: - id: 461c8d07f6da - last_write_checksum: sha1:9398f326377fe47f67af2df6eb6370750c0790b4 - pristine_git_object: 67bccfec985be20a00970d90155752832dd47135 - examples/.env.template: - id: 52cbe5afed92 - last_write_checksum: sha1:6f3d4d30718c09ccb1552fc3a005b76d0d01ad91 - pristine_git_object: 23674a47192b472fd08ccc1f47b36f6830db0686 - examples/README.md: - id: 9d0f69d6e677 - last_write_checksum: sha1:8503fc8653a5aaf1b1943ef20da54473fbe13bcb - pristine_git_object: b6858cb2d6d5ec4a54434d1985e806b2a851f397 - examples/companiesList.example.ts: - id: 21346a1a073c - last_write_checksum: sha1:7d5c984d99945447c76cdac2791121c8084de115 - pristine_git_object: 43452f74c97c2e1ccefaa0afb4ec7ac692316bad - examples/package.json: - id: c1d7b0ec8e7e - last_write_checksum: sha1:46d1568a018959876f6c0e99457cab5eacf6b34a - pristine_git_object: 6d1eb071735b1dd0227de5582c873a663c561f8f - jsr.json: - id: 7f6ab7767282 - last_write_checksum: sha1:23af4fa2e861f56d8cb064cd21f6894950743882 - pristine_git_object: f835e8b1c248cdc19c4d25b1e7849481a3c33eaf - package.json: - id: 7030d0b2f71b - last_write_checksum: sha1:8e0ce5e7a49cfb90cce4a9d2311fa974093f0e95 - pristine_git_object: 2e9cb4add2168a207fca3b1cfd4935a4ff221726 - src/core.ts: - id: f431fdbcd144 - last_write_checksum: sha1:4978134663ef926a733ddd85ae6b2216bed43bab - pristine_git_object: a84bafdec4daeec355016e668a7e2881c4719576 - src/funcs/accountsCreate.ts: - id: dcd4056ed25a - last_write_checksum: sha1:510c650d25773273546050333994a30e02650cdb - pristine_git_object: f60bd8bf5797d494133dc7acd8401cc358b77737 - src/funcs/accountsGetCreateModel.ts: - id: 94be81ee2370 - last_write_checksum: sha1:e2df12019651e93c70d9e23ebf3e39ab29805cc4 - pristine_git_object: de4cf0e953166b782696a302fff3f9e1cea738ea - src/funcs/adjustmentsCreate.ts: - id: 49ac36d1629e - last_write_checksum: sha1:1eea705e980c0e1fd396488242801b58e8e3559a - pristine_git_object: e123669ff6009ef6fec9c26cd4ae06e4ddfea918 - src/funcs/attachmentsUpload.ts: - id: dbc8c173c187 - last_write_checksum: sha1:53bbccbefc1d11e27f124cc0bd3519598771d33a - pristine_git_object: fe6c477b384d1af548d2cafd062f20df989dbfc5 - src/funcs/bankAccountsCreate.ts: - id: c61c77ddef33 - last_write_checksum: sha1:5133725be292e96e09bc6bbb2f9926e04c0fe667 - pristine_git_object: 74bb9f5a6c76d8ef3af7e249affa730ea259cc15 - src/funcs/bankAccountsGetCreateModel.ts: - id: 2b1d95b79b3b - last_write_checksum: sha1:6d003364902ea7d12b34a28e8d1524538059bc78 - pristine_git_object: fc344513bcf767c325d69848dfd6c5a968f3d9be - src/funcs/companiesCreate.ts: - id: becfb79b6222 - last_write_checksum: sha1:80a9991774ae34ce15c02a0b801a4bfb97ae54fa - pristine_git_object: db65a6aa67ca8ba7451bf0aa22fedc1f3e2fd6eb - src/funcs/companiesDelete.ts: - id: d4b8d3c15935 - last_write_checksum: sha1:e5de1a74b29ee438d4f5abad78162074b1b2e7a0 - pristine_git_object: 54b84aea99fdc6efc1120739a7b57d18b65dd781 - src/funcs/companiesGet.ts: - id: 497c5e9320c2 - last_write_checksum: sha1:056ed42c74d0eb1fc47edf2c621e7793a0757f27 - pristine_git_object: 82cfafe4e0c5d6a283e213e794cc75d94129822c - src/funcs/companiesList.ts: - id: c57fb769a99c - last_write_checksum: sha1:5dfe43699c68eba1cd3634d7f4c1dbc1ff05ebf7 - pristine_git_object: 6c11b88fdeaadb13554bda71b7a72b1dfa720dc8 - src/funcs/companiesReplace.ts: - id: c141cb91cc73 - last_write_checksum: sha1:4a8355731e6a93e4c0ddf9887620a7f6ec125287 - pristine_git_object: c654e336e3904377e637148d25121640e1539dc6 - src/funcs/companiesUpdate.ts: - id: e3d7bd676c21 - last_write_checksum: sha1:4a10e4e7a2900e1ddf3ac880153b1254ccc38c31 - pristine_git_object: 0be2e7bfbd388fd5b43d11e665fa03b0526083c9 - src/funcs/companyInfoGet.ts: - id: 4fa4126a1e45 - last_write_checksum: sha1:1c51518c73232bb039ea0d946fe369f0fb3380fc - pristine_git_object: a476e46c5af3309dbf3316d198a9e2caf654051f - src/funcs/configurationGet.ts: - id: 2a09a403f3a3 - last_write_checksum: sha1:170752e89cefddc68322486b22213172caafc438 - pristine_git_object: e3a57710cb6ccc69dda7ae7459ce08ea4a612bb6 - src/funcs/configurationSet.ts: - id: c2c0a934542f - last_write_checksum: sha1:ac6e15eab10cb3075beb4627b4a50d5ccd1e7c0f - pristine_git_object: c43d0ff4cdc8df80dc378f4963aa454fc650a11a - src/funcs/connectionsCreate.ts: - id: 0423cc2d060b - last_write_checksum: sha1:b78f0ee58d8e51f833d74af50ed25b321a76e311 - pristine_git_object: 0d71d66f94022ecebe56aba281a0a9ccfba640e8 - src/funcs/connectionsCreatePartnerExpenseConnection.ts: - id: 90ef51f407c9 - last_write_checksum: sha1:5fcc5005c65fdea6019135a055afd4647178b18f - pristine_git_object: d56f17b0f3c23e132a4f5e7bc27ee1ac1586d596 - src/funcs/connectionsDelete.ts: - id: f33b14b4a39d - last_write_checksum: sha1:49038fdc1b644e28ed14a67b341466a5b3069d36 - pristine_git_object: 3f2c7c764c5d30ba9d8632cea5751fd7459ec0f9 - src/funcs/connectionsGet.ts: - id: 6a1b6227b285 - last_write_checksum: sha1:6e68c1787fae1695a0a6c51a0bba6b49fbc2cbbc - pristine_git_object: f563555dd91e2767314b2d5a648ec2fcd3db6ad8 - src/funcs/connectionsList.ts: - id: ca36cb8b50d3 - last_write_checksum: sha1:71ba391c720662f3fbfcf8d8d20e2518975bfb87 - pristine_git_object: 3ae05a958deaea7fc3275745b60b57de0a35dc12 - src/funcs/connectionsUnlink.ts: - id: 0ff9d29a8016 - last_write_checksum: sha1:4a9772817e49ef1bca3b9ba3aa0f5bdc9f477128 - pristine_git_object: df877b4bc5bf64d1e9fafbb4ee57c7df93fd0ed3 - src/funcs/customersCreate.ts: - id: c42b63f0745d - last_write_checksum: sha1:e17200197d393d7e132da4a8952d3895e3e0cf0b - pristine_git_object: 6622d5c1444c8de29dc00afdce877113518cfe1f - src/funcs/customersGet.ts: - id: 02794d47465d - last_write_checksum: sha1:e811d1ec46cd2a9288fec4f2bf3a41163a55a205 - pristine_git_object: 83bd2c13b520cde31e6f56b609d219d2541453a8 - src/funcs/customersList.ts: - id: ec574597f882 - last_write_checksum: sha1:ac6e5298bbf19e018ce9806aa001a687added5d7 - pristine_git_object: ac28d2ec750ddb3d761b372962fd36db273a9e83 - src/funcs/customersUpdate.ts: - id: ab88ef0f82f9 - last_write_checksum: sha1:941d5266208028e7e2e7e0a0ae14dc952b456ef2 - pristine_git_object: 25137e04307cd3c5e3de3880ddc6fc98efe13953 - src/funcs/expensesCreate.ts: - id: df671604dee5 - last_write_checksum: sha1:73df6f76a3e23cf6dc5f4c7447add9ff5022a70b - pristine_git_object: 2d18fa86daa42d9edcbb7ab147533bf69d157d09 - src/funcs/expensesUpdate.ts: - id: 953533f0053b - last_write_checksum: sha1:2e8ea32794000eed08933de51f695a21cc6e42bf - pristine_git_object: a0fab447cebdbe5c8a2cb9bb874a7859d786d77a - src/funcs/manageDataGet.ts: - id: dc3d4ca6df0b - last_write_checksum: sha1:dc19ea2c5011d77dcd02fb37719128c6f32515b1 - pristine_git_object: 4ca71189bb7393f564cc4e7731eda30b2695bb9d - src/funcs/manageDataGetPullOperation.ts: - id: b5801141559c - last_write_checksum: sha1:d95675c9d008fc47e83590183f3a2e5c446e16ae - pristine_git_object: cd593a2e64ceac39c783993abdfd06eb497d462c - src/funcs/manageDataListPullOperations.ts: - id: c91274006ba5 - last_write_checksum: sha1:0eeeb30f053b263d9dd8e2274842fd16d2203e82 - pristine_git_object: d0ab41b0f5e7a456f7b825af75d4c0752d2ff8a4 - src/funcs/manageDataRefreshAllDataTypes.ts: - id: 401b7123b879 - last_write_checksum: sha1:b6ff26060c06770401fc93a083d71d0ac86ca5da - pristine_git_object: 0d3d3b3a64daeb922a375149bc4d18363eec78b2 - src/funcs/manageDataRefreshDataType.ts: - id: cbeed115504a - last_write_checksum: sha1:8ed6ffd3bd5b3283be50a1ce599c89cf8e6f3bb5 - pristine_git_object: 6e348a0afa2cb2cdd9956a750f54b9cbbaee0b62 - src/funcs/mappingOptionsGetMappingOptions.ts: - id: b07779fe65c6 - last_write_checksum: sha1:a710f5025bcc3ec6730d0b0face7b97f0598c4e9 - pristine_git_object: ccce86b8c0656a51751772543ec1173ded581ff8 - src/funcs/pushOperationsGet.ts: - id: ef52f8c025f6 - last_write_checksum: sha1:cde6e1f40af3032a7b1006755c13101eeebc6d2d - pristine_git_object: 874b28987f802189a984f88b1b3aadf36cbb12f0 - src/funcs/pushOperationsList.ts: - id: f77d5c58419d - last_write_checksum: sha1:a2d4129a799ca9a2d02669bda89855f03c5ecc39 - pristine_git_object: 8126236b698f408b384dbd55ab1d926b49db07a4 - src/funcs/reimbursementsCreate.ts: - id: df5476b3d4c4 - last_write_checksum: sha1:e0daf47106c334ce94ae6a0b92aa0ed52bf83c68 - pristine_git_object: 763b020f5917ac9505481b8b2dfdf7e38207ae6c - src/funcs/reimbursementsUpdate.ts: - id: 312aa782f01f - last_write_checksum: sha1:0f16b8f6c2c52729b6606010aed58385446b5904 - pristine_git_object: 7eae0e78e589b30351d52fb55d158a16b49e87f4 - src/funcs/suppliersCreate.ts: - id: ff2ee5ff481f - last_write_checksum: sha1:da45421c057633bd49bfa93db04b78b8a5c28e4e - pristine_git_object: d77d50ec19cd8a48f0408dd340c3f7d1f08b543a - src/funcs/suppliersGet.ts: - id: 7beb3b2ddb9d - last_write_checksum: sha1:3d908452c277622be41f36b996072de4db86be63 - pristine_git_object: 36b31c8feb7fea9419368c41f969f15e14bbfe1f - src/funcs/suppliersList.ts: - id: ae0c2ccb6871 - last_write_checksum: sha1:669b40015b4b19b090d35ad4c7248adf8a46812e - pristine_git_object: 5840cba713a6692e5d84486cb0f1fc728cb006ef - src/funcs/suppliersUpdate.ts: - id: c36b960e49de - last_write_checksum: sha1:f115872238e46c603105032d9c428981462048a0 - pristine_git_object: 90eb5ecc0d33f8f88c259aabb082aa969bc95704 - src/funcs/syncGet.ts: - id: 8c4d923b76d1 - last_write_checksum: sha1:7dac90944532cf35c00eb7665dd53fe611e48284 - pristine_git_object: 027117180a4616b5082c661f55a7962b6127549a - src/funcs/syncGetLastSuccessfulSync.ts: - id: ebf9b2719435 - last_write_checksum: sha1:7447168f2d2a163600225daaf3053821df3f4c95 - pristine_git_object: 4c5fb7e4816228e03099890b0a57ccb626230b5b - src/funcs/syncGetLatestSync.ts: - id: 079a1d16bff2 - last_write_checksum: sha1:48d92cc498faa0ac52d20f27270a86a8c2877574 - pristine_git_object: 4bf2be91aa3b9cd8f0e43935f1ac41cb1c9384b2 - src/funcs/syncList.ts: - id: 0f32f1d735f3 - last_write_checksum: sha1:c5240786df2393ff64ca6918d8926ffb3160fd62 - pristine_git_object: 4e99ce851103cdf00236953703135dfa4a482bbc - src/funcs/transactionStatusGet.ts: - id: 95ca22d8b933 - last_write_checksum: sha1:82d418693177057b008f04f8a75243dcbd906e74 - pristine_git_object: 49f575efb08548e05e87c125e60fe43ae580ba67 - src/funcs/transactionStatusList.ts: - id: 7ceab71677a1 - last_write_checksum: sha1:94b372223e7ff5d9e8e33ddecb3217e6e0964fab - pristine_git_object: 4af73ee5dd197dcec2b998525e5105a96ba1d390 - src/funcs/transfersCreate.ts: - id: 0bfa8fcb1442 - last_write_checksum: sha1:2a769febb048e1affc567fbbde36ade3b7239f66 - pristine_git_object: 5bd70d067f41b0e2134e01805ed9fb5019f786bc - src/funcs/validateWebhook.ts: - id: f3ebc1bebb84 - last_write_checksum: sha1:bb6b28f5167243d73fe1518a8ecae70beadf5a3f - pristine_git_object: 77bac9aaf67bc3e3c2842f5e9652d306d9fa08ae - src/hooks/hooks.ts: - id: a2463fc6f69b - last_write_checksum: sha1:9a569ea8f3177ddcdfe6cd903feaf5c2d2c36a9a - pristine_git_object: d34c88497fb1cfb22a725e52b4c218f36d0b5c8e - src/hooks/index.ts: - id: 5f2dab62b520 - last_write_checksum: sha1:1a11c073a6cd792932218e1d4ed36b8567bad8ef - pristine_git_object: f60ec7acd76141a71d78008c5a362eb0236d8335 - src/hooks/types.ts: - id: 2a02d86ec24f - last_write_checksum: sha1:a2145ca7943102b61791b4b067fb593f221349b3 - pristine_git_object: 494395f66d0a6de6f6cd8b1dc918557843158c1d - src/index.ts: - id: c5fb850250c7 - last_write_checksum: sha1:35c9cde3ae14b18b3f893a1afe8b6c44f8760f24 - pristine_git_object: dbcba164a0082e3bb8c43cf21fa7f8ffb9d35dfc - src/lib/base64.ts: - id: "598522066688" - last_write_checksum: sha1:b0b12ddbd8625efb47c0e955a18641aeb10c6532 - pristine_git_object: 0aebd8b0a4867e35cb3348fc52921c3c0b4725b7 - src/lib/config.ts: - id: 320761608fb3 - last_write_checksum: sha1:600135d04a173960cbc8e185e08d1745e7b8c567 - pristine_git_object: 450c22c01ccf871a604ac1ecd62ec6100eaf28f4 - src/lib/dlv.ts: - id: b1988214835a - last_write_checksum: sha1:1dd3e3fbb4550c4bf31f5ef997faff355d6f3250 - pristine_git_object: e81091f5e536f82739f71379b1fddc2d147c49e2 - src/lib/encodings.ts: - id: 3bd8ead98afd - last_write_checksum: sha1:d47614c415b37e092965c34cb668562195701004 - pristine_git_object: 2791d25bc4f7cf6eec17a65f899851e225fa3deb - src/lib/files.ts: - id: e5efa54fcb95 - last_write_checksum: sha1:795c14026405d547bfc47012f7ad9666e530fa7f - pristine_git_object: 6ca6b37d35a12448da176ee2517cc036db12c81c - src/lib/http.ts: - id: 63a80782d37e - last_write_checksum: sha1:797cbf16d3c7c4d62d3ba0eedb08617524938457 - pristine_git_object: 13cf1fd7894a89f727b8d2db2ad24313a94f68c7 - src/lib/is-plain-object.ts: - id: b9862591096a - last_write_checksum: sha1:df687f25a9590b6fd95d39df41a652ae3fd4e517 - pristine_git_object: 61070d3d7c7e5e95b1ed7e7ea21869eb0767db77 - src/lib/logger.ts: - id: 7ee7741a02bf - last_write_checksum: sha1:0ec9d3a2a34c362746b767e4f9a746c055d57a7b - pristine_git_object: d181f2937d4128afbe9b0327e0f81d1fa9c877b7 - src/lib/matchers.ts: - id: d54b2253b719 - last_write_checksum: sha1:4775ae173392e86f356bb1ffd0d16f3c2d7b0d54 - pristine_git_object: b096d6f201a8f1b24dea405dc0cb1c75efdf4c97 - src/lib/primitives.ts: - id: 74859f750b28 - last_write_checksum: sha1:987869fc54790b9c22e9182099103d6aa7c67016 - pristine_git_object: d21f1dc49affa4e6d324bdd60811b470fdfa7eb6 - src/lib/retries.ts: - id: b24a69d15639 - last_write_checksum: sha1:f3da74dffcbe2756c69393f8600205aa1dc06e68 - pristine_git_object: e3ce9aba72150fc3c18f3105d39b21aba809377b - src/lib/schemas.ts: - id: deb4b531fae1 - last_write_checksum: sha1:b8517a14d3043f488f44e3b10ddd6cabdd22242f - pristine_git_object: dc2510e330727b01894e4d3954ea92a62c962e5d - src/lib/sdks.ts: - id: 8a6d91f1218d - last_write_checksum: sha1:66d56bfdbd12a17c58ca2b03f6b10b1c34380dbe - pristine_git_object: 43fcf336ef4986ed91de77f38e0cc8b3d9c4ed76 - src/lib/security.ts: - id: 0502afa7922e - last_write_checksum: sha1:808e939964cd1393080c8b6428dabf33f746bae5 - pristine_git_object: 3da8e733b499dfb3c174dab84751a95ebc42324a - src/lib/url.ts: - id: b0057e24ed76 - last_write_checksum: sha1:3bceadd74bf0b31adf13eb06b7531077c3e07d65 - pristine_git_object: 79e7ce660b3732053e3adcbb5a4cdeb51496e8aa - src/sdk/accounts.ts: - id: a4031260e046 - last_write_checksum: sha1:daa7340b7ebc32a4c81b3262d3bc13cf5b534ce3 - pristine_git_object: 32022dc48d8e8cc825680cc4c1eb3d56f3d3038d - src/sdk/adjustments.ts: - id: d2ac5244377e - last_write_checksum: sha1:b022a93c34a3c34fbba0e581ab1b5c4bef070833 - pristine_git_object: ae4f7fb311aab30e84bbebbde13d0498735db57d - src/sdk/attachments.ts: - id: 01c3953a7152 - last_write_checksum: sha1:76d50aacef2fdd424feb35dd6423b2fcbf421894 - pristine_git_object: 8b35460c9b06c72c2bb7ddabde14aa95453fa723 - src/sdk/bankaccounts.ts: - id: 0f1139473f13 - last_write_checksum: sha1:e8703d3700a7a7063a4f5246869fc47ad5e090ca - pristine_git_object: 0babfd4c234f650fbd7f7d25599f340a5b63ce4e - src/sdk/companies.ts: - id: 7d7df3fca5ca - last_write_checksum: sha1:364a06b2420abe0ab8c6ce6839b6bba93acf1882 - pristine_git_object: 12e5f3369be005592affa22c2cd55803f45892f8 - src/sdk/companyinfo.ts: - id: 26e7094129e5 - last_write_checksum: sha1:e7c86a92f3f63114a996d63e99c7a95b9170f64e - pristine_git_object: 5c63a705d576cbe4bcadbe14dd2cddaab023a0ae - src/sdk/configuration.ts: - id: 747f245ccb04 - last_write_checksum: sha1:212324d41170d86d7e3e1f1b4982bb63665920fc - pristine_git_object: ba37739711d1fd002c547e6b9312a4df9c525724 - src/sdk/connections.ts: - id: 5992fff3b5cd - last_write_checksum: sha1:983f3555e8a2283cba23509db4e7bf4ece2aea42 - pristine_git_object: b028cd9e72d2ae83079be2c65cb893a5890f3466 - src/sdk/customers.ts: - id: d33e193e0c00 - last_write_checksum: sha1:54ecdd2b609979d8a142f3783fc2fdb850cc1001 - pristine_git_object: ca4606be66a08866521c1811f173ac2fae242ec0 - src/sdk/expenses.ts: - id: 89aab5f46e2b - last_write_checksum: sha1:880e3d224651de364aa27a3eb8a1570c375032e2 - pristine_git_object: 96497a4af36f298d0feda7b1c610467425a8cbc1 - src/sdk/index.ts: - id: a857902a703f - last_write_checksum: sha1:ed6d64f2a6135349aa8498b8d8cff9ba85c7fb8f - pristine_git_object: ecac2264817bb369ff2dbf0f0e9029807e67ff77 - src/sdk/managedata.ts: - id: c8cbe5c105ff - last_write_checksum: sha1:940a4a57c769ccd28dc9d3abee4a53427ac1fa4a - pristine_git_object: abc8b7a38bf7f40dc85fa3f59063608263af7402 - src/sdk/mappingoptions.ts: - id: 2a288f6944bc - last_write_checksum: sha1:a9b5acc8b32499fe6f006fa086eecf4d736edbd1 - pristine_git_object: ece14c6cf1ccba0e43b506174628d40ff89e27a9 - src/sdk/models/errors/codatsyncexpenseserror.ts: - id: c71eeae8cb54 - last_write_checksum: sha1:80b5bd16a457b1a51cad4166cff2b0ce72293771 - pristine_git_object: fceb467de6f35f455b0d1c53c426dce09c0b238c - src/sdk/models/errors/errormessage.ts: - id: 2bc5b9b70870 - last_write_checksum: sha1:955302cffb7db734dec70dbcdb4133387d51d8b3 - pristine_git_object: 91cc428f921986e1b740ec5559525204d14fe159 - src/sdk/models/errors/httpclienterrors.ts: - id: 7be0894f205a - last_write_checksum: sha1:994ced121c54fecd0af038ccfb7855fbfd3868ec - pristine_git_object: b34f612124c797c2a1106b9735708f679a90b74f - src/sdk/models/errors/index.ts: - id: 017ae2dc215b - last_write_checksum: sha1:04e3b23ae339742f0991fba4595d1a06c8e9ff64 - pristine_git_object: 7d14c11266fd69986a5bd250264256e47af65113 - src/sdk/models/errors/responsevalidationerror.ts: - id: 0b76670204e7 - last_write_checksum: sha1:0f005f1cec08a041f6208724f0f12f4ebfc0b7d3 - pristine_git_object: ea5e04dbad1a4d92b14b41b94b318ae255d8e1ad - src/sdk/models/errors/sdkerror.ts: - id: c231fdf3b914 - last_write_checksum: sha1:d152f2973648948808ef3c2a21e2ad54399819c5 - pristine_git_object: dc0c6970648cbfb42317c3f4cef4e687321d93af - src/sdk/models/errors/sdkvalidationerror.ts: - id: 7c8a11e099b9 - last_write_checksum: sha1:a69da17627bcc32b820544608f3400423ea53f26 - pristine_git_object: 6826e1208a5d7b7d310535d18909646522bf0fbd - src/sdk/models/operations/createaccount.ts: - id: 905f20b16869 - last_write_checksum: sha1:81621d593d75d516704aaf12faaa6ec994e600f6 - pristine_git_object: d8d3f68e1ee4e022893cdd8de794877b326cb1cc - src/sdk/models/operations/createadjustmenttransaction.ts: - id: 86cd66a83435 - last_write_checksum: sha1:1b677387b6f2a1d23f73e36b3fb5d638454a94d4 - pristine_git_object: 9282464cc38014c8adfd4c33027e660d14ae37f3 - src/sdk/models/operations/createbankaccount.ts: - id: 384f1f4b636d - last_write_checksum: sha1:1a711fea2b22d1efd1c6473e2c156b9f3d259be9 - pristine_git_object: dde96c24e68f2d5a8e50088e747725b5580c5228 - src/sdk/models/operations/createconnection.ts: - id: fd864cebfe91 - last_write_checksum: sha1:67abdd42c0f4b8669b59225b4cf97763bd0cca4c - pristine_git_object: dc5bcac12be709864c1f9a57ab0591899995abeb - src/sdk/models/operations/createcustomer.ts: - id: 00e2cfc2681f - last_write_checksum: sha1:b1fc8159e7ca6d67a2de1a5bdcd09b3c3533883b - pristine_git_object: 57054a54bf610d64efa736090d5eb448026fad8b - src/sdk/models/operations/createexpensetransaction.ts: - id: 8283928ba0bd - last_write_checksum: sha1:ff6aac2f133f83cbcc4f73c3ebc6c940be234663 - pristine_git_object: 4e9f5f6af80629cd439d7b3c9abefaa0c56c2eca - src/sdk/models/operations/createpartnerexpenseconnection.ts: - id: 1e47c7e9eee5 - last_write_checksum: sha1:eadce62853528b604b6a381d80643cd04421a291 - pristine_git_object: 7b71c8039a4ae0c086f6a08b093ed4b0408e51e3 - src/sdk/models/operations/createreimbursableexpensetransaction.ts: - id: 11b03ae7a0ed - last_write_checksum: sha1:924a7269310716cfcb60b26eafba678a36eb5b76 - pristine_git_object: 996da57c963fb32ee8b624eaa8f93192840f26b0 - src/sdk/models/operations/createsupplier.ts: - id: 3ac2b8655cd3 - last_write_checksum: sha1:94da000b8ea1a946a72cc7a3116f363f6d4ff6c7 - pristine_git_object: 8022daa8cabbc83b9222ddc7d633083da9afcb23 - src/sdk/models/operations/createtransfertransaction.ts: - id: 7d9973fe595d - last_write_checksum: sha1:1cb609fd8b716cb9699a2a6f95233b7c1e767b66 - pristine_git_object: ca8dae247aa217f95f0a29ef4ef3787106dcd95b - src/sdk/models/operations/deletecompany.ts: - id: feff26e831a7 - last_write_checksum: sha1:3c6c30970b77ef97770f4a9fed7866b08bfd1ad0 - pristine_git_object: dbe555534894ed6e7f64cf4f034fff5fb58ddedb - src/sdk/models/operations/deleteconnection.ts: - id: 918aad3d3a4a - last_write_checksum: sha1:47fa476012d016921380a863c5457ef7babdd186 - pristine_git_object: 83f75997084050b7c35824dc9e065e81e3677b69 - src/sdk/models/operations/getcompany.ts: - id: 4bef19281ada - last_write_checksum: sha1:3c30540e6bcdad8e8a51c616dc9e9b21934890ca - pristine_git_object: 77734decc381321230c2bfb8f340633b2064f315 - src/sdk/models/operations/getcompanyconfiguration.ts: - id: 5f47aebaa208 - last_write_checksum: sha1:3b9d67b47dddfe8debad8763d5bcaffb4e22e258 - pristine_git_object: 92ae8a4982a8bb87eb35f2bc3a35d320bfc37aee - src/sdk/models/operations/getcompanyinfo.ts: - id: d8b295b50903 - last_write_checksum: sha1:2e77a56ae39883a847350c5d01d31806a50a942a - pristine_git_object: b3eb61f13b049bafff0ae41a9033b7221b0d643c - src/sdk/models/operations/getconnection.ts: - id: e6be8d1eab2c - last_write_checksum: sha1:94309b857129d317a91f50bae1e58ab670779062 - pristine_git_object: 126d23b8515e33d0e3c796e642e68ee0f74a6e00 - src/sdk/models/operations/getcreatebankaccountsmodel.ts: - id: d2a66212235e - last_write_checksum: sha1:fc4bd85addf7319a97a5a9d57bb5de0e824bc8b2 - pristine_git_object: 455e4e838e4ab6d1db4d47c8850f33ce8398d32c - src/sdk/models/operations/getcreatechartofaccountsmodel.ts: - id: 9f0a3d0670c8 - last_write_checksum: sha1:33c89501771920391bb5916d24232bf7b3810b83 - pristine_git_object: d3b2a28a66da9dda64e2806620138bc1beaa4286 - src/sdk/models/operations/getcustomer.ts: - id: 565597aa3278 - last_write_checksum: sha1:769e69f6b07079a3366e8d3725052031f4499729 - pristine_git_object: 81a814931d44e728c655d0f857b7d712cb8892f6 - src/sdk/models/operations/getdatastatus.ts: - id: ebdcbcbe4aef - last_write_checksum: sha1:df819cbd9de3b0b3f98ed53309f6f92f68e1b4b9 - pristine_git_object: e53d4c2a1a1c3beef9498b8cdd2ca659a0cf9979 - src/sdk/models/operations/getlastsuccessfulsync.ts: - id: ca114ef6d5c1 - last_write_checksum: sha1:8b14392ad78bef7e32eb5a28f5d1c64806690721 - pristine_git_object: f34d49fb61ebadb4b79d56d549fbaa93b866db70 - src/sdk/models/operations/getlatestsync.ts: - id: bfa3f43e50c8 - last_write_checksum: sha1:0a50bd34d04cc73e8d5de0f40bfac4affae7bbcb - pristine_git_object: 79ec54e8f6618744b04110fba6b52a63c9d62152 - src/sdk/models/operations/getmappingoptions.ts: - id: adedac16e2ed - last_write_checksum: sha1:b2bade0de1677ddf70807683b0b3f28642ede8df - pristine_git_object: 8a198d5ad2327575da05ce30671b6be27d920795 - src/sdk/models/operations/getpulloperation.ts: - id: 72377e8b61d4 - last_write_checksum: sha1:0a0b81f1f3c3e124585a2be4e7325117c1d059cc - pristine_git_object: 2df9079da61727da96e0e5e57f9ba0f006c66aaf - src/sdk/models/operations/getpushoperation.ts: - id: 8b4e8573095d - last_write_checksum: sha1:e1cc048f6fff1b438aeb09e26ddd44e37f49b8e2 - pristine_git_object: 3a950624c21d3161701867af7743651708053b6f - src/sdk/models/operations/getsupplier.ts: - id: c2fe96db53c6 - last_write_checksum: sha1:9151e8143a0487fefe5d3d61bca0b5772e522933 - pristine_git_object: 6b849a6cd5e470592bc19b02b93ec17cd586a3c5 - src/sdk/models/operations/getsyncbyid.ts: - id: 3324f1ac7360 - last_write_checksum: sha1:e2bf355084c6993d3f1b48e2d8a4777672235104 - pristine_git_object: 9b31d1939602e33577cdfb11d327cf0c0dcc2e21 - src/sdk/models/operations/getsynctransaction.ts: - id: d3ade2a85202 - last_write_checksum: sha1:abb9f94feda800f8f757e3c89496c3ee21ac23f9 - pristine_git_object: 0f6f9b131d943c82e4a4b6a268cf888e4fec0a47 - src/sdk/models/operations/index.ts: - id: b2864d0519d7 - last_write_checksum: sha1:8eeae46b84699878dce150c8c7edef1346034b15 - pristine_git_object: 41dbedfe6b7376ca58a04182782eb091cdec2961 - src/sdk/models/operations/listcompanies.ts: - id: bd514f2d5c1c - last_write_checksum: sha1:1487d8f67d5a1c439e6581e854213aa1a386b9f3 - pristine_git_object: 837a6aae587e8a038402fbcedcd4fcc1873136ba - src/sdk/models/operations/listconnections.ts: - id: 5797f5b9be29 - last_write_checksum: sha1:0e709e410d2b500143f63d78e8eaa9ce4c810a6d - pristine_git_object: d1be0d9421b3b0d768650208abc91adcf7a9b721 - src/sdk/models/operations/listcustomers.ts: - id: 0c1c94e3aafd - last_write_checksum: sha1:559a4af72513a522c3a2d757e8d1740558d62e8c - pristine_git_object: df64364b9a983ef38f94706584d64632e55cb0da - src/sdk/models/operations/listpulloperations.ts: - id: 2f2dc545b414 - last_write_checksum: sha1:07db30cc5a51f31a8b19823b0248e852b13949d4 - pristine_git_object: d12f7bd86d6d9180c2042db5b65d5858f3d0c770 - src/sdk/models/operations/listpushoperations.ts: - id: d222dee2db76 - last_write_checksum: sha1:ff8ddb0760b339d9a387f998bbe61ab6b598b237 - pristine_git_object: f4617795665da43f1b717533ace47619ab5b5a34 - src/sdk/models/operations/listsuppliers.ts: - id: 5bd206cb074d - last_write_checksum: sha1:d37b07b62eda9e81d7efd94860723ecc80aebebd - pristine_git_object: 0b72b9ddc86f2756cd811b4092997bf053f36b6d - src/sdk/models/operations/listsyncs.ts: - id: fb1b5eb6a5dd - last_write_checksum: sha1:ed42d6ef5b3f6f8f35b498b2ae5cffe339256c7d - pristine_git_object: 0fd0f5150abee371b20b1515055c1a21696f5d1b - src/sdk/models/operations/listsynctransactions.ts: - id: 01ebb276981c - last_write_checksum: sha1:2a7c3b10f47523270956303fcaa657a150047ae0 - pristine_git_object: 1023458abb8dbe17413d7ff8ddb7a8461cc202ab - src/sdk/models/operations/refreshalldatatypes.ts: - id: 01573fc6fa44 - last_write_checksum: sha1:af36165b1abc045e74af458d280d0da10fa266f4 - pristine_git_object: de184ca9a7a63e876e5ffb070ec2eadc355d51bf - src/sdk/models/operations/refreshdatatype.ts: - id: 3b0dec3e2d72 - last_write_checksum: sha1:765304ce6411f8877b6d7e69270679ad53fa553b - pristine_git_object: 6b357ce8805aa5a113a8ddc573b334edccb1e248 - src/sdk/models/operations/replacecompany.ts: - id: 15f9deaaf7eb - last_write_checksum: sha1:dd56621b0a190db2faed25c4f3f8ccc58c20210e - pristine_git_object: 5ee35551d47caea122b4f502f81b95691cc291ef - src/sdk/models/operations/setcompanyconfiguration.ts: - id: b1f77555d135 - last_write_checksum: sha1:175a5f6965ee20f778eb7a1b6cff39dcaa04702c - pristine_git_object: 6040c8b7c727ec85df13b9e3221c77387408cdfc - src/sdk/models/operations/unlinkconnection.ts: - id: 91e6d25ecd14 - last_write_checksum: sha1:5f4e32b0424df5658a94c777839f8a75adbe40ed - pristine_git_object: dbdba4a38ab397554e0d92300812dda648e941fd - src/sdk/models/operations/updatecompany.ts: - id: dbafb9e0f8d9 - last_write_checksum: sha1:937aaa5e965aae942c6550456dbe3c37b5d2b280 - pristine_git_object: 37ead4428659b0b2409ad7f6cf54515e544e23ec - src/sdk/models/operations/updatecustomer.ts: - id: 3c3df1728f2b - last_write_checksum: sha1:8cbb27b974a9e7b9943b346c254448045ba1432f - pristine_git_object: 04698340a01fbe1483d9ee30359053c2b4424a66 - src/sdk/models/operations/updateexpensetransaction.ts: - id: 82ff9b9787e5 - last_write_checksum: sha1:e983c3fa1c4ba2953c031ea8e1ade30a735e52d9 - pristine_git_object: 4e1347a0295bb0421b186de441637f5e09c2aa3c - src/sdk/models/operations/updatereimbursableexpensetransaction.ts: - id: efbbd1817b07 - last_write_checksum: sha1:b1cec8c617c6c5cb428a1443b3bb7808204acd51 - pristine_git_object: 39e89ab2a1a1b566f6e2408260eb953c2c9ac158 - src/sdk/models/operations/updatesupplier.ts: - id: 4c259e646cb1 - last_write_checksum: sha1:0080741725aeace331e838f4c9fc3c6f243ae906 - pristine_git_object: 17fb665a5c58f80361c34538c37cd668bb32640f - src/sdk/models/operations/uploadexpenseattachment.ts: - id: 0652e914b50e - last_write_checksum: sha1:24cbc00c71351d492fd949c7d9d01b7dd73cbc4a - pristine_git_object: eef9b6596c3bb2e8b3d6e1a02ddd814f118f9821 - src/sdk/models/shared/accountingaddresstype.ts: - id: e3226e442011 - last_write_checksum: sha1:cff7184a3e368ccf099122029411f7f9c890bdda - pristine_git_object: 2f4e3b7a6eb1e4a17b9bbd9caa214c113784dca7 - src/sdk/models/shared/accountmappinginfo.ts: - id: 3fba03a8fd0d - last_write_checksum: sha1:65578227610bb3fa0bdeb57add57ddc18d8ed6b0 - pristine_git_object: 7341c4006c291c4c11e290feac24a4e763e1f263 - src/sdk/models/shared/accountprototype.ts: - id: ffd99325161b - last_write_checksum: sha1:e0854582c13be8739970f6c332a5754698a326f3 - pristine_git_object: cc5b1ee1791cd67ec342f61ea41e45ea73c4b137 - src/sdk/models/shared/accountstatus.ts: - id: d3b6d9d9dc1b - last_write_checksum: sha1:3d8da8c7cf6f158b91daab66c4783ddd1c9b7cd6 - pristine_git_object: 12278d094d4d7cb42873c74360d4f673ddd9e8f7 - src/sdk/models/shared/accounttype.ts: - id: d660396c78b5 - last_write_checksum: sha1:ec24c5608bc06b63cdede8ec919bf951dcdb14f8 - pristine_git_object: c71262dc67fea5fde0ee8745924e6c5472c7924e - src/sdk/models/shared/adjustmenttransactionline.ts: - id: db3c470a1501 - last_write_checksum: sha1:6cf12b91c40bde5f874af436ea4e9755a2203c58 - pristine_git_object: 4055522504c0ed02b90abe46b539a41ef5fa2074 - src/sdk/models/shared/adjustmenttransactionrequest.ts: - id: 810ce527423a - last_write_checksum: sha1:4cf06c2eba7cabb704f12ca4b5afbfcf20b44d4f - pristine_git_object: 211f76e27d7fcfcade8a112513599e8313e584a6 - src/sdk/models/shared/adjustmenttransactionresponse.ts: - id: f302843a6c85 - last_write_checksum: sha1:9bbbe607415f6e14694be052a06fa977d211a3ae - pristine_git_object: 4edb3094b58d4376873ffc114ef696d2d5d2a452 - src/sdk/models/shared/apaccountref.ts: - id: b84d733a82b3 - last_write_checksum: sha1:e97bae8f579483bbc5cb026bc5cfc3573cb28d88 - pristine_git_object: a40de9884755993a37cb3e632fadf06eb0a0dfe0 - src/sdk/models/shared/attachment.ts: - id: 22576f5ca1b9 - last_write_checksum: sha1:9c0e777c214c00c9b40a8ace6f1a8134dee27583 - pristine_git_object: 795c67ad8451e7ac749d25fc1e2872065b2e475a - src/sdk/models/shared/attachmentupload.ts: - id: 6a392fdeca2f - last_write_checksum: sha1:641e54fc2352b948d32b49bd9024807e63554757 - pristine_git_object: 9d175ab2154386e54a967876024acc02dff71994 - src/sdk/models/shared/bankaccount.ts: - id: d58b53d62458 - last_write_checksum: sha1:d13774269aed149921c3e3dc9b938b146ba619ff - pristine_git_object: 433ac67bca434c2eaa828b3398512208aba3dcc7 - src/sdk/models/shared/bankaccountdetails.ts: - id: ccedf1b98c18 - last_write_checksum: sha1:961ddbdc2f84ef92b5c62a159371bef4273e46c1 - pristine_git_object: 3f1bddb89667ecb1556b43891a2bb6b85ca72363 - src/sdk/models/shared/bankaccountstatus.ts: - id: 01e2b1dd61c8 - last_write_checksum: sha1:f52ba944c93769df04b70451d9e993db5e89571f - pristine_git_object: bca71b03045f81a36808773116eaa37664a1e10b - src/sdk/models/shared/clientratelimitwebhook.ts: - id: c691f6d7f890 - last_write_checksum: sha1:873cdc12f8278470e382ae879c4bb2eb17f7f029 - pristine_git_object: cdc40c0b87eb15c3725596b713a38dec90aa9083 - src/sdk/models/shared/clientratelimitwebhookpayload.ts: - id: d068d62c8d39 - last_write_checksum: sha1:e9a21951c06c14ff5a39fd7379cd1c3bafc314d1 - pristine_git_object: 72605d6242434c3e2be999f0006634d5a193e129 - src/sdk/models/shared/codatfile.ts: - id: c7308ff582f1 - last_write_checksum: sha1:46a60236564ab061fff7b8496ad94922d8284ade - pristine_git_object: 0bc3490e3175f93bfcdf04ef1d88f4f56f9771c2 - src/sdk/models/shared/companies.ts: - id: a4b81f9ba7c8 - last_write_checksum: sha1:81432b885d166aad72ebfcdf5b25eb9c822545b4 - pristine_git_object: 0f308542ebb67c7b1d3262721bbe236d1176ef3c - src/sdk/models/shared/company.ts: - id: 8f41ac6a5b4f - last_write_checksum: sha1:efdbf7e89c8e68e6ba9b28e7659b8285b43d837b - pristine_git_object: adc722807f52db782ecea09440050e98c0fb661d - src/sdk/models/shared/companyconfiguration.ts: - id: 14cbcd5da94b - last_write_checksum: sha1:ec31aa9d8d33fa4d133405136fbb3cd0665db83b - pristine_git_object: c3de39ac9b876dcddc8affcbbed7447d5b9119df - src/sdk/models/shared/companyinformation.ts: - id: 1ebdfe14e999 - last_write_checksum: sha1:23b255a1893da6d7725f9433d86a4598b44655d6 - pristine_git_object: 624491b9f5c3600763f3685d28c936f103afb6a6 - src/sdk/models/shared/companyreference.ts: - id: f80ee466bdc7 - last_write_checksum: sha1:a13593197e2c55252dac28abfd5493a76a400e5b - pristine_git_object: e40af5e267211b26d0d3b0296484b7450c485126 - src/sdk/models/shared/companyrequestbody.ts: - id: 9e2dd8b2247d - last_write_checksum: sha1:a3027f00426e9affb8b7f8d930db63b89c197607 - pristine_git_object: 5e438635a0842512ed8dd3a9ee464187ed7ff3fe - src/sdk/models/shared/companysyncstatus.ts: - id: 39bc93a979c5 - last_write_checksum: sha1:e5ee1afec23a784e2f88752ff5ef5822fcb31e9c - pristine_git_object: 72e7076d356d4e2e2e5c18b05e95610256ba7f07 - src/sdk/models/shared/companyupdaterequest.ts: - id: 9a4400207ec8 - last_write_checksum: sha1:371f7f83676f4130f9885c506c8184c53e202390 - pristine_git_object: 442b7a78cb3fde01477e7bb5cec5626c06a9a58b - src/sdk/models/shared/connection.ts: - id: 18ea99cdadfb - last_write_checksum: sha1:faf22fd94b824713602bf5603e3dcaacfcec524e - pristine_git_object: cc4e99380dc3bc4e1bef98b00bca9b16f79938ce - src/sdk/models/shared/connections.ts: - id: 221acd1ae99a - last_write_checksum: sha1:ef2d949a3163430d3095303bf231c18b7dc93c9c - pristine_git_object: 1278d54c36183c06f6113dd14c25f115be7a6465 - src/sdk/models/shared/contact.ts: - id: 0500236ba8d4 - last_write_checksum: sha1:b8fef6d8c102ea909c4848685dc00e9a6757d676 - pristine_git_object: 8b386531d0e58190d119e83c4901dcca97514266 - src/sdk/models/shared/createaccountresponse.ts: - id: 03c9d30999ae - last_write_checksum: sha1:ff63007ab937646d8ffa021f0f39baefb9735608 - pristine_git_object: 139da5baa0737a2f83bf976502641b95ca992ce4 - src/sdk/models/shared/createbankaccountresponse.ts: - id: 1aa1544fcee4 - last_write_checksum: sha1:ff26ef00fda87ae5d71f035caa3a14793eaa2e36 - pristine_git_object: a469b4f9a9a978732aeafd791cfdb60fa8e0996f - src/sdk/models/shared/createcustomerresponse.ts: - id: 60a9c685822b - last_write_checksum: sha1:fde66de8462747c4918a3cba4df341dc576f74ce - pristine_git_object: 70a6883c3da8192b6dab8e2c7b9bc81ce446a0e0 - src/sdk/models/shared/createexpenseresponse.ts: - id: 676e70c88c68 - last_write_checksum: sha1:2a9e56a4b19cdaec83a3136a097fd80f45bdb3f9 - pristine_git_object: 06b938906978e3a72d04532a795481625f33bd05 - src/sdk/models/shared/createreimbursableexpenseresponse.ts: - id: 90d0584df99a - last_write_checksum: sha1:e1a4ecd0b0742291d89a7476517560f6e33ca004 - pristine_git_object: 4e9005bea2b7d5bbcaf8111d6f9dba19acce8dcb - src/sdk/models/shared/createsupplierresponse.ts: - id: f7a96df2f35c - last_write_checksum: sha1:d77b4835622e6085947512ff39826cb0947eed19 - pristine_git_object: 1f0ed566409914485d9f4a39af7be280f5411f36 - src/sdk/models/shared/customer.ts: - id: 0461159f3445 - last_write_checksum: sha1:f33d7ce65ecfe6f4554860aae9e18967e0dd1b1e - pristine_git_object: 27486842be09e7d124ff894b8ec2d6ae08a32c95 - src/sdk/models/shared/customerdetails.ts: - id: dbf290575362 - last_write_checksum: sha1:639816731a882a6074b2d3de15ac5c95691d7234 - pristine_git_object: 63b35720deee532bcda2c5c574174f6ae58f2633 - src/sdk/models/shared/customers.ts: - id: 523f4ca27bc8 - last_write_checksum: sha1:c3fc81f2e26ada332ce76d1008fed367c9222f71 - pristine_git_object: 1ab0447562347a7a572cf903dda2a84f8a17026d - src/sdk/models/shared/customerstatus.ts: - id: a715f684b8e2 - last_write_checksum: sha1:de855607d6dd15165f942a60ad97967659202c5a - pristine_git_object: 8529e7f29d09526b967b0545ee1ca30cb6f9eba8 - src/sdk/models/shared/dataconnectionerror.ts: - id: c94cddffcec9 - last_write_checksum: sha1:e968b9983e395410ddd93aa9967671e46066eae2 - pristine_git_object: 1cb816d0f2b87e31e36ad1ece98b6f25bcdb148b - src/sdk/models/shared/dataconnectionstatus.ts: - id: 506ff77d012f - last_write_checksum: sha1:6ab2241aa8830aafaeb937d48e97918a68b9dac7 - pristine_git_object: 88889c800a39f393c9445929bbd2150fc6daf7ca - src/sdk/models/shared/datastatus.ts: - id: 4f56e78a99e5 - last_write_checksum: sha1:eba6dba549c86bfcde0d6bcc81c5d74a1d19fd00 - pristine_git_object: 431478c2d5b04d59350c804a78382def3f19baed - src/sdk/models/shared/datatype.ts: - id: 24637063ef68 - last_write_checksum: sha1:f0315c100cd3ecd8937418bc588d9be930a0d440 - pristine_git_object: e1060cb84379a05c7d444157842b05ca51b4019c - src/sdk/models/shared/definitiontransaction.ts: - id: a65574329354 - last_write_checksum: sha1:8489d99e46d1f8273f69d6068767addf599582d1 - pristine_git_object: 9fe243202e0388e736086b9f588ba97fd6d9b631 - src/sdk/models/shared/errorvalidation.ts: - id: 7595eed057da - last_write_checksum: sha1:b7f44c1f99c9de84a9177a6fba2f76704a894a48 - pristine_git_object: dc97b86b1b0a47cc49cc6ce168bbf2dc7362a7d4 - src/sdk/models/shared/errorvalidationitem.ts: - id: 0fbe584c7194 - last_write_checksum: sha1:ea42d03e55f11719c38dc24ffdd5d982be3b1ce3 - pristine_git_object: cd21ec230bfad899a805264c87467c3a1762e9bc - src/sdk/models/shared/expensecontactref.ts: - id: 43899d9f4030 - last_write_checksum: sha1:9038f5d2c67b09d536f317f79aac95abe781c3fb - pristine_git_object: 70e6d0f30aaf031fa3d9781ef4ebd21694d2f5ad - src/sdk/models/shared/expensessyncwebhook.ts: - id: 42ad7ceed53e - last_write_checksum: sha1:6ce82d31b659b22e47e78572e0e651b0f340655b - pristine_git_object: 850b509a397b85b41f62b17dc0e6e1d26430d9ad - src/sdk/models/shared/expensessyncwebhookpayload.ts: - id: ee50e885662e - last_write_checksum: sha1:aae2d903326534a6b3cb8b1d2928c29b8acc2ff2 - pristine_git_object: e0777d0ac0bb1c3a064ab40f3291a6f213d4e696 - src/sdk/models/shared/expensetransaction.ts: - id: 95975b7aa661 - last_write_checksum: sha1:4c244a773cd4cb9b860be3506dd1f28a0f03202a - pristine_git_object: c7d431f6b8690addd09cddd97001efbc07364963 - src/sdk/models/shared/expensetransactionline.ts: - id: ae44108881ac - last_write_checksum: sha1:12b8105c685c24b11c06679ee1a292869d815a86 - pristine_git_object: 4b25bc4d287364a0b9c72f9a191adf9b4a020e74 - src/sdk/models/shared/halref.ts: - id: 1c4609be4603 - last_write_checksum: sha1:b64b146493fe3613970c549edffd33e58402662a - pristine_git_object: 921d594fb96fe80f20787e9118d3def4a9e2d53c - src/sdk/models/shared/index.ts: - id: e97e906e3c14 - last_write_checksum: sha1:33e2da246cf029e624886c7620591db0adb1af25 - pristine_git_object: 9a07f8d8867a4d38223892213ca2fbc4ab797324 - src/sdk/models/shared/integrationtype.ts: - id: 7aed19d9e901 - last_write_checksum: sha1:15995af3ca6a7e3c2f6376c70b44e9d56148d545 - pristine_git_object: 405241c43469fd007ccec20cc34cb37f9bd10b16 - src/sdk/models/shared/invoiceto.ts: - id: c1bfbcefc4a6 - last_write_checksum: sha1:8632d93f4e00c41c311fb88a42c3960eed18d396 - pristine_git_object: 4821b5efcfdd446017523d63cb33237287e935a0 - src/sdk/models/shared/itemref.ts: - id: 7c811d63335d - last_write_checksum: sha1:97213b984da296d911ddcd429f366213eb447144 - pristine_git_object: c50859078190e68d20af9700ae10adf514d14e8f - src/sdk/models/shared/items.ts: - id: 9bf34b20cc56 - last_write_checksum: sha1:e4cb618c32c8f96042ca9822d1428644d0c33e32 - pristine_git_object: 71bef42e67cbc3ec2503baaed55de464adae8c9a - src/sdk/models/shared/links.ts: - id: 5c9b3efadf74 - last_write_checksum: sha1:453659d4b39a592c99b3b459eb9f44055f4c4195 - pristine_git_object: 751d7d00e4248ebfd0d28dadcc799607e058635b - src/sdk/models/shared/mappingoptions.ts: - id: b942ed328ff5 - last_write_checksum: sha1:500bd17a5b477cd9fd3452e6d57aea59c8de9b85 - pristine_git_object: c4cdff83d58daaf3b5c38e8430447691f420ac92 - src/sdk/models/shared/metadata.ts: - id: ee8aa545e342 - last_write_checksum: sha1:9639bb68412a237bd695de4fb124c3d4093117e6 - pristine_git_object: 4a678ba939b63cd6d8e9074658de2375891ff222 - src/sdk/models/shared/phonenumberitems.ts: - id: 0c7ee5a7c3bb - last_write_checksum: sha1:5b4ebb4c806d77243d65a341642ca133ee304f6a - pristine_git_object: 25b1718094ecf433268cc6e51db7cad84f8931c6 - src/sdk/models/shared/propertiedatatype.ts: - id: 4ea125ec9d70 - last_write_checksum: sha1:b926d63fd60306b126cbb858d25a22313d3d9311 - pristine_git_object: a71dac4dd4afa1f66c22f575f8659083a3678657 - src/sdk/models/shared/pulloperation.ts: - id: 1c7a111bf82e - last_write_checksum: sha1:e82d9cd137c0d78465d050b4d8b1a368b31eb6e2 - pristine_git_object: 39375036856ebf027357ff9e00321f4a91f2f806 - src/sdk/models/shared/pulloperations.ts: - id: b51faf4dfd99 - last_write_checksum: sha1:869f7219c72b210af77791cdf5d866c6e39788a8 - pristine_git_object: 475158a0012b764dc1b95440b859651810d0bc07 - src/sdk/models/shared/pushchangetype.ts: - id: cf67386a1d21 - last_write_checksum: sha1:455bd6b2ebf2a0aeee8a914030cc903e9fb12b47 - pristine_git_object: 42040ea23eda83d8cb202d9f3239f5a7c62f4bd2 - src/sdk/models/shared/pushfieldvalidation.ts: - id: 8d8e835e5634 - last_write_checksum: sha1:c377b5bd6ef9fd9ab4e480b3e7e9e2a974a741a8 - pristine_git_object: 15fc3a0f565d8c493fb5461a56309ecadbdd69b2 - src/sdk/models/shared/pushoperation.ts: - id: b6592db339e9 - last_write_checksum: sha1:a6277535acc2f3717de7a769db831f60a2fea704 - pristine_git_object: b9563094c73aa4a8e8e7bba349dae1801873eee2 - src/sdk/models/shared/pushoperationchange.ts: - id: 137f5337781d - last_write_checksum: sha1:c4fcd4f27955e10750e151667bb4ed7b1ecf29f9 - pristine_git_object: 5d771700a367ef509098146f474f10136fe3a577 - src/sdk/models/shared/pushoperationref.ts: - id: 61a311ce2153 - last_write_checksum: sha1:f123aa4fd1f944977c603f63c7e001d7086121aa - pristine_git_object: 59aa761013ab6d2792f63d7d1226311c1aabc405 - src/sdk/models/shared/pushoperations.ts: - id: b0489702427e - last_write_checksum: sha1:df0ddbf54bebf12f184c59ce0b7f9cdf5df010c9 - pristine_git_object: 35c08c7262eaf602936441cf831b2d63aafe9faf - src/sdk/models/shared/pushoperationstatus.ts: - id: 4d9d57d9f800 - last_write_checksum: sha1:7de289ab7d0d5365eae9fe17aed4caddaed26622 - pristine_git_object: 133e3b65f122ffae8912b5ca2a3e91c190c97ddf - src/sdk/models/shared/pushoption.ts: - id: 7b36845bb057 - last_write_checksum: sha1:e6da3557367628a63dd0789986bda82a2ac1c8a9 - pristine_git_object: af6a0a0a363f287ee7bc1e6a19bd87942579dfa7 - src/sdk/models/shared/pushoptionchoice.ts: - id: 4f9141171f1d - last_write_checksum: sha1:a254424966daf3d5185d1b272d0f2214424dce0f - pristine_git_object: 315b39f913390a0e7a4785a7d1c7f21693c7ca9d - src/sdk/models/shared/pushoptionproperty.ts: - id: 27745de0e67f - last_write_checksum: sha1:dd3f7838ac5ff9f5edc531b7bddc809dac397111 - pristine_git_object: 0100bc7b68eb80d19a298dc7276202c9faf85575 - src/sdk/models/shared/pushoptiontype.ts: - id: 4f2314173517 - last_write_checksum: sha1:795906b3ad06204f1dcc551385d5bb849607f61a - pristine_git_object: 298c02e2ea74d44d765eebcb7cc7b1054226aed7 - src/sdk/models/shared/pushvalidationinfo.ts: - id: c3bac2e0d020 - last_write_checksum: sha1:233611708647ac824c46a354d05fc0f3b87cdbe3 - pristine_git_object: 3479adce121324a58a8bb938a974762be7f3cae0 - src/sdk/models/shared/recordref.ts: - id: aaacf769d2aa - last_write_checksum: sha1:5ec7668a0c4008901740ca97ecd492d14da72b06 - pristine_git_object: ef4753cd00534ee63990f5c15cf23aca8721caba - src/sdk/models/shared/reimbursableexpensetransaction.ts: - id: 54c884235299 - last_write_checksum: sha1:b2b42f29d921feef53542cae837256f54fb8e62d - pristine_git_object: 82f1cbf58fb7433234e25b0eb876477d8c94e8a1 - src/sdk/models/shared/reimbursableexpensetransactionline.ts: - id: e5c70b9cfea0 - last_write_checksum: sha1:d2cc3b1caaaa831f9e6829bc097b1090cb6642e2 - pristine_git_object: c3acb46f313c529b37d4c712e2bfea5956ffd4c5 - src/sdk/models/shared/reimbursementcontactref.ts: - id: ffb307a2d5e7 - last_write_checksum: sha1:17533d74b8624cc512ca75a9acd6f0b0a649bc8f - pristine_git_object: cef4be224a447c7ef43bfee904564298e53ce06c - src/sdk/models/shared/security.ts: - id: 4a9790ed1c2f - last_write_checksum: sha1:1b51b365245ab2a0f5f5a06b90093bceb61fc084 - pristine_git_object: 675eaa5827f48cff71e28d1627f8d65a74e10623 - src/sdk/models/shared/status.ts: - id: 1ab31ee187e8 - last_write_checksum: sha1:32b3b6aa4030d2fc4688dd986f9872a86a1abe46 - pristine_git_object: 7b458b0a812628f48c33f789fe66d2fedf4c2e18 - src/sdk/models/shared/supplementaldata.ts: - id: c6dd9a2794e4 - last_write_checksum: sha1:af016589e19361a69323899755b0cd3080109e3e - pristine_git_object: bdea4887c8e5644d591b12f8097e75855b309620 - src/sdk/models/shared/supplier.ts: - id: 1bed69e4bad9 - last_write_checksum: sha1:c097d2df3c7893227ba6bf843cd62f5c56b5a232 - pristine_git_object: 9b5b3bdbb030db6a2c16d3f92a4c4e5817a62313 - src/sdk/models/shared/supplierdetails.ts: - id: 5aae26f65f1e - last_write_checksum: sha1:ae928c77134b0fff387786f0679ce4144d883960 - pristine_git_object: c6b2329d69ae2fa31d53b408225cc60a4f885a54 - src/sdk/models/shared/suppliers.ts: - id: c62b9ef17289 - last_write_checksum: sha1:9c09c3f20edc728016ab59cabbc6608599fa492d - pristine_git_object: 46de174dc4b4c6240c67ec96611007bf1f468f72 - src/sdk/models/shared/supplierstatus.ts: - id: 507c6db656fa - last_write_checksum: sha1:9d4da55011629bd22151f5c1443c7004811a4d8c - pristine_git_object: 21b6220e1fcb3d01f5cbecc67b1213167b6b158d - src/sdk/models/shared/taxratemappinginfo.ts: - id: 3015f9f4efd1 - last_write_checksum: sha1:f67194b1e5c9809fa5c2da5755607eb50503478c - pristine_git_object: 9cb982b911c500e2dca9214b766f31d9606ff75f - src/sdk/models/shared/trackingcategorymappinginfo.ts: - id: 5089c0f34783 - last_write_checksum: sha1:eddfa9f1d64de48534dbb50a4beac34082f4f05d - pristine_git_object: 112aac93d398c5005335ac87f4f5fb8f819c398f - src/sdk/models/shared/trackingref.ts: - id: a863d4731f94 - last_write_checksum: sha1:694ada5b151cf37eb4217673d9b34959fff10e50 - pristine_git_object: 11809c369eb342640a141650dd823a2b31aa3fa9 - src/sdk/models/shared/trackingrefadjustmenttransaction.ts: - id: df78bd3cb01d - last_write_checksum: sha1:8f34b359ea59bea48f3191304b27e5e2a842a0fc - pristine_git_object: 661d5e5fba4c71d2cb7f422be40900a66a5a54b0 - src/sdk/models/shared/transaction.ts: - id: 15e03bc730fe - last_write_checksum: sha1:246adea77a6f5ce98103fad324c6073cb4bc6c84 - pristine_git_object: 7f205c6f31fb3cd290996cafcc588d736f5d38c7 - src/sdk/models/shared/transactions.ts: - id: 85dead1772b5 - last_write_checksum: sha1:894088c52d89aa29ef42fc2ec2d1b946da8a5d58 - pristine_git_object: e88e27437d975a835e2916e4664e2b9b4e609783 - src/sdk/models/shared/transactionstatus.ts: - id: 2e473ce8e9ba - last_write_checksum: sha1:a43d729a74e0a3c21c82973686aee3a9b5770953 - pristine_git_object: a3c87f7290b1e2167c0ea42397e87d06d35ca269 - src/sdk/models/shared/transfertransactionrequest.ts: - id: 2c6c9aa03f0f - last_write_checksum: sha1:03a3a3e102b0a61be85ffa736834c5ac6ef54462 - pristine_git_object: 1f8432823b74d8ba0a6767fd8145a95053d5e134 - src/sdk/models/shared/transfertransactionresponse.ts: - id: 580e9c29d7d7 - last_write_checksum: sha1:c0f5aee2bc54aedd369c123f6bda4bf820da3c62 - pristine_git_object: 4356c2411e620390240d83270bd2848910b1658c - src/sdk/models/shared/updatecustomerresponse.ts: - id: 0cd35c66c59e - last_write_checksum: sha1:79ba566ae87ad26b1a2b96e0860d9d2409972246 - pristine_git_object: 3057b181e32abc6f7023b5dbd34f67d8d635514d - src/sdk/models/shared/updateexpenserequest.ts: - id: 0c13d1a2d14e - last_write_checksum: sha1:ab575720004f0005682a1029c152bc344126d557 - pristine_git_object: 119ee0aeb17047469888c5a4a44855803f2121fe - src/sdk/models/shared/updateexpenseresponse.ts: - id: 128e3655aafd - last_write_checksum: sha1:539b8eff0c78ad56ea6f93f8351fdfd13cafc2ff - pristine_git_object: 4843efea096c1c9b250425302007f9d9db0b896a - src/sdk/models/shared/updatereimbursableexpensetransactionrequest.ts: - id: 48e930635a89 - last_write_checksum: sha1:0826d088d1c22e5fb708387618c9d123f3d6f2b2 - pristine_git_object: 1b58eaa213ff86819fd9e1b050345fcd9c108ce4 - src/sdk/models/shared/updatesupplierresponse.ts: - id: 898b61502a60 - last_write_checksum: sha1:8a358ee50a0e320686ed2d901ca1458593750d14 - pristine_git_object: 249e3024095ad8e27a399ed4c97f448f8158371c - src/sdk/models/shared/validation.ts: - id: e4418d9ed08e - last_write_checksum: sha1:ecb74ca87689c6554c1520c793ce71f4d889f15c - pristine_git_object: 3a6a92030507280977e021e0012fd0064b5debff - src/sdk/models/shared/validationitem.ts: - id: 0e34cb6ff62f - last_write_checksum: sha1:7f82caee4bbad4d6d8ddf69c64bf3ebdfdf492cd - pristine_git_object: ca354aa0beffed45e429ad92c2b3e14df222ec00 - src/sdk/models/shared/validfor.ts: - id: bce41b8c301d - last_write_checksum: sha1:ba706b1d322193114ffe33ec319cac0b7f301eaa - pristine_git_object: cc19074ade0454890961e38b4df4504ee9fbc722 - src/sdk/models/shared/validtransactiontypes.ts: - id: f6316fba8167 - last_write_checksum: sha1:f81430a0ff261d012c9c15535cb28ca441c3f39e - pristine_git_object: d113dc77961dcba70318ad403e872aae31209fde - src/sdk/pushoperations.ts: - id: 51542fbcd4f3 - last_write_checksum: sha1:c1d08061b9cbc7bbadb62ca1b13cc45b19776962 - pristine_git_object: deb3ed6aea9c98d7c176ec45ce7848c9f3d300db - src/sdk/reimbursements.ts: - id: c6f5b5cd4a71 - last_write_checksum: sha1:f7aa59445681e30169d4499154eba79823ceeee5 - pristine_git_object: 0b805081ca82a77d0f4a3c59808b47f185947209 - src/sdk/sdk.ts: - id: 784571af2f69 - last_write_checksum: sha1:354162a6f542b670dd9b15cd67f75acec139b4cb - pristine_git_object: e63b02426cc55b7a08cc610894de74c7cc1427a7 - src/sdk/suppliers.ts: - id: 68b234e74022 - last_write_checksum: sha1:dccefa84c128332a1ca1a6b189682e530c8ac18b - pristine_git_object: f0e3efff3e95eeeb1085dd9cb7349490a552dc52 - src/sdk/sync.ts: - id: 2e323d0b48d5 - last_write_checksum: sha1:4f0e40b8be8322eb22afcfab031adc26bbdd4df6 - pristine_git_object: c40062f86a91884f370735befef6d3e7952920ad - src/sdk/transactionstatus.ts: - id: 8063a8351642 - last_write_checksum: sha1:f99fb9825962a3eea6b8ebb1848306b6f972c95f - pristine_git_object: 14229325a5aefaaea6b3b86bfbbe212c7f65e078 - src/sdk/transfers.ts: - id: 1e842c518280 - last_write_checksum: sha1:743f04ebcbfed4e7294da882a5fa8d984f0efb98 - pristine_git_object: d225138ea187cf8442a57d39c404cc39c9ccc724 - src/sdk/types/async.ts: - id: 966026768b05 - last_write_checksum: sha1:3ff07b3feaf390ec1aeb18ff938e139c6c4a9585 - pristine_git_object: 689dba5de50e8769e5f3bb913e3f42a146d15bc1 - src/sdk/types/blobs.ts: - id: 1def31341768 - last_write_checksum: sha1:cf45d78916671cb6345a11c97c633c64402bc27c - pristine_git_object: cce2892d4f573a120ef3907db90ab15f5979cfda - src/sdk/types/constdatetime.ts: - id: 7e64cb450e63 - last_write_checksum: sha1:dfaaf9adfaf49808bd4c9dea0039f21b7088d9c0 - pristine_git_object: fe62144eaf6a2054fc8ca9a98466e70f41b5434d - src/sdk/types/decimal.ts: - id: 4c47ee438ee8 - last_write_checksum: sha1:9e679d0ebb0a5b1efcbae4926d24893181f3fe8f - pristine_git_object: a7895d555b147e9bf9e3cd79f0b0e9f340d5ecd1 - src/sdk/types/enums.ts: - id: 2ac17fb928cd - last_write_checksum: sha1:ee590453d2c87e33e89c633d37ee46907eca0e58 - pristine_git_object: aba0ffd2a3308a31e516d83b52823d80aa65a8f9 - src/sdk/types/fp.ts: - id: d9ec77b9460c - last_write_checksum: sha1:d24994d58f37a1ca106847fcc6d2e976c6f1c093 - pristine_git_object: ccbe51eac69dfb0da5131f14fd753c4b47c1d527 - src/sdk/types/index.ts: - id: 8c869d66c5f3 - last_write_checksum: sha1:0e06df309f1646981212f4103ea27cbd65e1f50e - pristine_git_object: 19a7bd013477d20d80a670e6833a0f0c9b1c8aa7 - src/sdk/types/operations.ts: - id: c5e9c75d4266 - last_write_checksum: sha1:c49e724cfb1259296381cb57bc0fcdd2eae45865 - pristine_git_object: beb81e10f0b9eee2ed398a853fe6f737b743f818 - src/sdk/types/rfcdate.ts: - id: fc969c92a7c1 - last_write_checksum: sha1:8e5f382e02fe21c2f2e24deb1b7bbf8cddd3dd16 - pristine_git_object: c79b3f53a3dd922aa2ace5a4191c8652cf9a8e89 - src/sdk/types/streams.ts: - id: e556b428e8dc - last_write_checksum: sha1:cc9ced2dd34a76c3a1bd7784ccda1cc3b37ab9a9 - pristine_git_object: a0163e7a99cea88f21d0ad4ce3af1c720180ee20 - src/sdk/types/unrecognized.ts: - id: 690d294a1973 - last_write_checksum: sha1:d33ac686528492f4cdc0dbf81ed343b4afe020fe - pristine_git_object: b7a2a13f3dff50663429df24ae2f55b647ff1084 - src/sdk/types/webhooks.ts: - id: 0f676e5e22a7 - last_write_checksum: sha1:dbce0cb417bcdcfcae0827fa045ee93ccab1c2c8 - pristine_git_object: 9510d20c09d8dd689f6e37254030de22e997f3cc - tsconfig.json: - id: 61ebb9fd6e8c - last_write_checksum: sha1:79dc1550d921fefec69f8632ed3b24dad41ca2f6 - pristine_git_object: 76110f883cac40bb04fb2f376cd69ea8c8d6d215 -examples: - list-companies: - speakeasy-default-list-companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - One company: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "name": "My Test Company", "description": "My Test Company make testing software", "redirect": "https://link.codat.io/company/3fa85f64-5717-4562-b3fc-2c963f66afa6", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Mike Smith", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/3fa85f64-5717-4562-b3fc-2c963f66afa6/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 1, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - List of Companies: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "200": - application/json: {"results": [{"id": "d1568dde-adf6-11ed-afa1-0242ac120002", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/d1568dde-adf6-11ed-afa1-0242ac120002", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z", "createdByUserName": "Joe Bloggs", "products": ["spend-insights", "lending", "payables-v2"], "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "51baa045-4836-4317-a42e-3542e991e581", "integrationId": "1c312d69-e638-46d4-ad31-72e6c3ba8390", "integrationKey": "vjms", "sourceId": "396c3158-5dd7-481b-a7c4-a795ca31792b", "sourceType": "Accounting", "platformName": "Pandle", "linkUrl": "https://link-api.codat.io/companies/d1568dde-adf6-11ed-afa1-0242ac120002/connections/51baa045-4836-4317-a42e-3542e991e581/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []}, {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["lending", "spend-insights", "payables"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "redirect": "https://link.codat.io/company/db94eddc-9212-4568-9b5c-3eab0e325913", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/connections/1e5c8c9e-27fd-4ba9-9a2a-d02ba65bc2fb/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]}], "pageNumber": 1, "pageSize": 100, "totalResults": 3, "_links": {"self": {"href": "/companies"}, "current": {"href": "/companies?page=1&pageSize=100"}}} - Malformed query: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - tags: "region=uk && team=invoice-finance" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-company: - With no description: - requestBody: - application/json: {"name": "Technicalium"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a description: - requestBody: - application/json: {"name": "Technicalium", "description": "Technology services, including web and app design and development"} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "Technology services, including web and app design and development", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - With a tag: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Technicalium", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18.1950523Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights"], "tags": {"region": "us"}, "referenceSubsidiaryCompanies": [], "dataConnections": []} - Malformed query: - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - replace-company: - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "New Name"} - responses: - "200": - application/json: {"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", "products": ["spend-insights", "lending"], "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", "sourceType": "Banking", "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"}]} - "401": - application/json: {} - "500": - application/json: {} - Update description: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Same name", "description": "Additional documents required"} - responses: - "200": - application/json: {"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", "products": ["spend-insights", "lending"], "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", "sourceType": "Banking", "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"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-replace-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"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", "products": ["spend-insights", "lending"], "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", "sourceType": "Banking", "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"}]} - "401": - application/json: {} - "500": - application/json: {} - update-company: - Update tags: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"tags": {"refrence": "new reference"}} - responses: - "200": - application/json: {"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", "products": ["spend-insights", "lending"], "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", "sourceType": "Banking", "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"}]} - "401": - application/json: {} - "500": - application/json: {} - Update name: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "New Name"} - responses: - "200": - application/json: {"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", "products": ["spend-insights", "lending"], "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", "sourceType": "Banking", "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"}]} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"name": "Bank of Dave", "description": "Requested early access to the new financing scheme."} - responses: - "200": - application/json: {"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", "products": ["spend-insights", "lending"], "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", "sourceType": "Banking", "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"}]} - "401": - application/json: {} - "500": - application/json: {} - delete-company: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {} - "500": - application/json: {} - get-company: - Simple company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores holdings", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [], "dataConnections": []} - Parent multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "description": "", "redirect": "https://link.codat.io/company/ab12c58d-a678-4ebf-a159-ae99e1807bd0", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceSubsidiaryCompanies": [{"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "links": {"portal": "https://app.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/summary"}}, {"id": "db94eddc-9212-4568-9b5c-3eab0e325913", "name": "Toft stores US", "links": {"portal": "https://app.codat.io/companies/db94eddc-9212-4568-9b5c-3eab0e325913/summary"}}], "dataConnections": []} - Subsidiary multi-entity company: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "c8d3af58-7011-47ce-b3f2-89faf300ef6d", "name": "Toft stores UK", "description": "", "redirect": "https://link.codat.io/company/c8d3af58-7011-47ce-b3f2-89faf300ef6d", "created": "2022-11-10T10:45:18Z", "createdByUserName": "Dan Tzabar", "products": ["spend-insights", "lending", "expenses-v1", "commerce"], "referenceParentCompany": {"id": "ab12c58d-a678-4ebf-a159-ae99e1807bd0", "name": "Toft stores", "links": {"portal": "https://app.codat.io/companies/ab12c58d-a678-4ebf-a159-ae99e1807bd0/summary"}}, "referenceSubsidiaryCompanies": [], "dataConnections": [{"id": "d5ab61b7-1ad0-46fd-9f9f-b6761047941e", "integrationId": "cc750323-5a47-4f28-8d8e-30fbbf2ce137", "integrationKey": "akxx", "sourceId": "9815b998-024d-4415-a40b-89903b2cad6f", "sourceType": "Accounting", "platformName": "Oracle NetSuite", "linkUrl": "https://link-api.codat.io/companies/c8d3af58-7011-47ce-b3f2-89faf300ef6d/connections/d5ab61b7-1ad0-46fd-9f9f-b6761047941e/start", "status": "Linked", "lastSync": "2022-01-01T12:30:00.000Z", "created": "2022-01-01T11:30:00Z"}]} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-connections: - speakeasy-default-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: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - 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: {"results": [{"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "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"}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "string"}, "current": {"href": "string"}, "next": {"href": "string"}, "previous": {"href": "string"}}} - 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: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - 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: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "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"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"platformKey": "gbol"} - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-connection: - Connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "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"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - delete-connection: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-delete-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {} - "500": - application/json: {} - 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: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "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"} - "401": - application/json: {} - "500": - application/json: {} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-unlink-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "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"} - "401": - application/json: {} - "500": - application/json: {} - create-partner-expense-connection: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-partner-expense-connection: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"id": "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", "integrationId": "bf083d72-62c7-493e-aec9-81b4dbba7e2c", "integrationKey": "dfxm", "sourceId": "bdd831ce-eebd-4896-89a7-20e5ee8989ee", "sourceType": "Banking", "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"} - "400": - application/json: {} - "500": - application/json: {} - get-company-info: - Example 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"companyName": "Codat", "accountingPlatformRef": "1700060034_ETD", "companyLegalName": "Codat Ltd", "addresses": [{"type": "Billing", "line1": "301 Ink Rooms", "line2": "28 Easton Street", "city": "London", "region": "England", "country": "United Kingdom", "postalCode": "WC1X 0BE"}, {"type": "Delivery", "line1": "28 Easton Street", "city": "London", "country": "UK", "postalCode": "WC1X 0BE"}], "phoneNumbers": [{"number": "02012 345678", "type": "Landline"}, {"number": "07123 456789", "type": "Mobile"}, {"number": "02012 345678", "type": "Fax"}], "webLinks": [{"type": "Website", "url": "https://www.codat.io/"}, {"type": "Social", "url": "https://www.linkedin.com/company/codat-limited/"}], "registrationNumber": "5590111724", "taxNumber": "74111622555799035846", "financialYearStartDate": "2023-04-01T00:00:00", "baseCurrency": "GBP", "sourceUrls": {"Api": "https://api.codat.io"}, "createdDate": "2020-03-09T15:19:26"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-company-configuration: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-company-configuration: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"bankAccount": {"id": "32"}, "supplier": {}, "customer": {}} - "401": - application/json: {} - "500": - application/json: {} - set-company-configuration: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"bankAccount": {"id": "32"}, "supplier": {}, "customer": {}} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-set-company-configuration: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: {"bankAccount": {"id": "32"}, "supplier": {}, "customer": {}} - responses: - "200": - application/json: {"bankAccount": {"id": "32"}, "supplier": {}, "customer": {}} - "400": - application/json: {} - "500": - application/json: {} - get-mapping-options: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-mapping-options: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"expenseProvider": "Partner Expense", "accounts": [{"id": "127f3b99-8dc2-4b7e-854c-91ef9bd2757b", "nominalCode": "300", "name": "Purchases", "currency": "GBP", "accountType": "Expense", "fullyQualifiedCategory": "Expense.DirectCosts", "validTransactionTypes": ["Payment"], "validFor": ["expense-transactions.Payment"]}], "trackingCategories": [{"id": "DEPARTMENT_2", "name": "New York", "parentId": "DEPARTMENTS"}], "taxRates": [{"id": "23_Bills", "name": "20% Bill tax Bills", "code": "20% Bill tax", "effectiveTaxRate": 20, "totalTaxRate": 20, "validTransactionTypes": ["Payment"]}]} - "401": - application/json: {} - "500": - application/json: {} - get-last-successful-sync: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-last-successful-sync: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"companyId": "d4d73051-ed31-42b6-99f6-d288cd940992", "syncId": "a6a22aff-a43a-411d-a910-2dae73217cce", "syncStatusCode": 2000, "syncStatus": "Complete", "syncUtc": "2022-10-23T00:00:00Z"} - "401": - application/json: {} - "500": - application/json: {} - get-latest-sync: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-latest-sync: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"companyId": "d4d73051-ed31-42b6-99f6-d288cd940992", "syncId": "a6a22aff-a43a-411d-a910-2dae73217cce", "syncStatusCode": 2000, "syncStatus": "Complete", "syncUtc": "2022-10-23T00:00:00Z"} - "401": - application/json: {} - "500": - application/json: {} - list-syncs: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-syncs: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: [{"companyId": "d4d73051-ed31-42b6-99f6-d288cd940992", "syncId": "a6a22aff-a43a-411d-a910-2dae73217cce", "syncStatusCode": 2000, "syncStatus": "Complete", "syncUtc": "2022-10-23T00:00:00Z"}] - "401": - application/json: {} - "500": - application/json: {} - get-sync-by-id: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-sync-by-id: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - responses: - "200": - application/json: {"companyId": "d4d73051-ed31-42b6-99f6-d288cd940992", "syncId": "a6a22aff-a43a-411d-a910-2dae73217cce", "syncStatusCode": 2000, "syncStatus": "Complete", "syncUtc": "2022-10-23T00:00:00Z"} - "401": - application/json: {} - "500": - application/json: {} - list-sync-transactions: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - query: - page: 1 - pageSize: 100 - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - query: - page: 1 - pageSize: 100 - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-list-sync-transactions: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - query: - page: 1 - pageSize: 100 - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - get-sync-transaction: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-sync-transaction: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - responses: - "200": - application/json: [{"transactionId": "aa02271d-ed5f-47f5-be76-778d5905225a", "status": "Completed", "integrationType": "expenses"}] - "401": - application/json: {} - "500": - application/json: {} - create-expense-transaction: - Payment: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "type": "Payment", "issueDate": "2024-05-21T00:00:00+00:00", "currency": "GBP", "currencyRate": 1, "contactRef": {"id": "430", "type": "Supplier"}, "bankAccountRef": {"id": "97"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "35"}, "trackingRefs": [{"id": "DEPARTMENT_5", "dataType": "trackingCategories"}], "invoiceTo": {"id": "504", "type": "customer"}}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - "400": - application/json: {} - "500": - application/json: {} - Refund: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "7008d3f2-aeb4-11ed-afa1-0242ac120002", "type": "Refund", "issueDate": "2024-02-17T00:00:00+00:00", "currency": "GBP", "contactRef": {"id": "430", "type": "Supplier"}, "bankAccountRef": {"id": "97"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "42"}, "trackingRefs": [{"id": "DEPARTMENT_6", "dataType": "trackingCategories"}]}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - "400": - application/json: {} - "500": - application/json: {} - Example 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "a44135b0-6882-489a-83fe-a0c57a4afb19", "type": "Payment", "issueDate": "2024-05-21T00:00:00+00:00", "currency": "GBP", "currencyRate": 1, "contactRef": {"id": "430", "type": "Supplier"}, "bankAccountRef": {"id": "97"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "35"}, "trackingRefs": [{"id": "DEPARTMENT_3", "dataType": "trackingCategories"}, {"dataType": "trackingCategories"}], "invoiceTo": {"id": "504", "type": "customer"}}], "notes": "amazon purchase"}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "a44135b0-6882-489a-83fe-a0c57a4afb19", "type": "Payment", "issueDate": "2024-05-21T00:00:00+00:00", "currency": "GBP", "currencyRate": 1, "contactRef": {"id": "430", "type": "Supplier"}, "bankAccountRef": {"id": "97"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "35"}, "trackingRefs": [{"id": "DEPARTMENT_3", "dataType": "trackingCategories"}, {"dataType": "trackingCategories"}], "invoiceTo": {"id": "504", "type": "customer"}}], "notes": "amazon purchase"}] - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-expense-transaction: - Payment: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"type": "Payment", "issueDate": "2024-05-21T00:00:00+00:00", "currency": "GBP", "currencyRate": 1, "contactRef": {"id": "430", "type": "Supplier"}, "bankAccountRef": {"id": "97"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "35"}, "trackingRefs": [{"id": "DEPARTMENT_5", "dataType": "trackingCategories"}], "invoiceTo": {"id": "504", "type": "customer"}}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"} - responses: - "202": - application/json: {"syncId": "1ad0695c-4566-4715-918c-adbb03eac81e"} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"type": "Payment", "issueDate": "2022-06-28T00:00:00.000Z", "currency": "GBP", "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd", "type": "Supplier"}, "bankAccountRef": {"id": "787dfb37-5707-4dc0-8a86-8d74e4cc78ea"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "itemRef": null, "trackingRefs": null, "invoiceTo": null}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-expense-transaction: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"type": "Payment", "issueDate": "2022-06-28T00:00:00.000Z", "currency": "GBP", "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd", "type": "Supplier"}, "bankAccountRef": {"id": "787dfb37-5707-4dc0-8a86-8d74e4cc78ea"}, "merchantName": "Amazon UK", "lines": [{"netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "itemRef": null, "trackingRefs": null, "invoiceTo": null}], "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590"} - responses: - "202": - application/json: {"syncId": "1ad0695c-4566-4715-918c-adbb03eac81e"} - "400": - application/json: {} - "500": - application/json: {} - create-transfer-transaction: - Create transfer: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"description": "Sample transfer description", "date": "2021-05-21T00:00:00+00:00", "from": {"accountRef": {"id": "787dfb37-5707-4dc0-8a86-8d74e4cc78ea"}, "amount": 100}, "to": {"accountRef": {"id": "777dfb37-5506-3dc0-6g86-8d34z4cc78ea"}, "amount": 100}} - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - "400": - application/json: {} - "500": - application/json: {} - Example 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"description": "Transfer from bank account Y to bank account Z", "date": "2022-10-23T00:00:00Z", "from": {"accountRef": {"id": ""}, "amount": 7329.18}, "to": {"accountRef": {"id": ""}, "amount": 522.15}} - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"description": "Transfer from bank account Y to bank account Z", "date": "2022-10-23T00:00:00Z", "from": {"accountRef": {"id": ""}, "amount": 7329.18}, "to": {"accountRef": {"id": ""}, "amount": 522.15}} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-adjustment-transaction: - Create adjustment: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "3357b3df-5f2e-465d-b9ba-226519dbb8f1", "date": "2024-05-21T00:00:00+00:00", "currency": "USD", "currencyRate": 1, "reference": "test reference", "lines": [{"amount": 50, "accountRef": {"id": "80000018-1671793811"}, "description": "debit line", "trackingRefs": [{"id": "80000003-1674553958", "dataType": "trackingCategories"}], "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}}, {"amount": -50, "accountRef": {"id": "80000028-1671794219"}, "description": "credit line", "trackingRefs": [{"id": "80000003-1674553958", "dataType": "trackingCategories"}]}]}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - "400": - application/json: {} - "500": - application/json: {} - Example 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "6a13b8cf-d482-4389-9f93-08d52faa3dc0", "date": "2022-10-23T00:00:00Z", "currency": "Lilangeni", "lines": []}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "6a13b8cf-d482-4389-9f93-08d52faa3dc0", "date": "2022-10-23T00:00:00Z", "currency": "Lilangeni", "lines": []}] - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-reimbursable-expense-transaction: - Create reimbursable expense: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "reference": "expenses w/c 01/07", "contactRef": {"id": "752"}, "issueDate": "2024-05-21", "dueDate": "2024-05-21", "currency": "GBP", "currencyRate": 1, "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "lines": [{"description": "Hotel", "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "35"}, "trackingRefs": [{"id": "DEPARTMENT_5", "dataType": "trackingCategories"}], "invoiceTo": {"id": "504", "type": "customer"}}]}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - "400": - application/json: {} - "500": - application/json: {} - Example 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "apAccountRef": null, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "lines": [{"description": "2-night hotel stay", "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "itemRef": {"id": "80000002-1675158984"}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}], "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}}]}] - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - requestBody: - application/json: [{"id": "4d7c6929-7770-412b-91bb-44d3bc71d111", "contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "apAccountRef": null, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "lines": [{"description": "2-night hotel stay", "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "itemRef": {"id": "80000002-1675158984"}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}], "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}}]}] - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - update-reimbursable-expense-transaction: - Update reimbursable expense: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"reference": "expenses w/c 01/07", "contactRef": {"id": "752"}, "issueDate": "2024-05-21", "dueDate": "2024-05-21", "currency": "GBP", "currencyRate": 1, "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "lines": [{"description": "Hotel", "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "23_Bills"}, "accountRef": {"id": "35"}, "trackingRefs": [{"id": "DEPARTMENT_5", "dataType": "trackingCategories"}], "invoiceTo": {"id": "504", "type": "customer"}}]} - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - "400": - application/json: {} - "500": - application/json: {} - Example 1: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "apAccountRef": {"id": "8000004C-1724173136"}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "lines": [{"description": "2-night hotel stay", "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "itemRef": {"id": "80000002-1675158984"}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}], "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}}]} - responses: - "200": - application/json: {"syncId": "cd937d46-8e41-43a9-9477-a79158ffd98a"} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - requestBody: - application/json: {"contactRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "apAccountRef": {"id": "8000004C-1724173136"}, "issueDate": "2022-10-23T00:00:00Z", "dueDate": "2022-10-23T00:00:00Z", "currency": "GBP", "notes": "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", "lines": [{"description": "2-night hotel stay", "netAmount": 100, "taxAmount": 20, "taxRateRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "accountRef": {"id": "40e3e57c-2322-4898-966c-ca41adfd23fd"}, "itemRef": {"id": "80000002-1675158984"}, "trackingRefs": [{"id": "e9a1b63d-9ff0-40e7-8038-016354b987e6", "dataType": "trackingCategories"}], "invoiceTo": {"id": "80000002-1674552702", "type": "customer"}}]} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - upload-expense-attachment: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-upload-expense-attachment: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002" - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee" - responses: - "200": - application/json: {} - "400": - application/json: {} - "500": - application/json: {} - refresh-all-data-types: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-refresh-all-data-types: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "400": - application/json: {} - "500": - application/json: {} - get-data-status: - Example: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "200": - application/json: {"accountTransactions": {"dataType": "accountTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "balanceSheet": {"dataType": "balanceSheet", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankAccounts": {"dataType": "bankAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bankTransactions": {"dataType": "bankTransactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billCreditNotes": {"dataType": "billCreditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "billPayments": {"dataType": "billPayments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "bills": {"dataType": "bills", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "cashFlowStatement": {"dataType": "cashFlowStatement", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "chartOfAccounts": {"dataType": "chartOfAccounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "company": {"dataType": "company", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "creditNotes": {"dataType": "creditNotes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "customers": {"dataType": "customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directCosts": {"dataType": "directCosts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "directIncomes": {"dataType": "directIncomes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "invoices": {"dataType": "invoices", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "itemReceipts": {"dataType": "itemReceipts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "items": {"dataType": "items", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journalEntries": {"dataType": "journalEntries", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "journals": {"dataType": "journals", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "paymentMethods": {"dataType": "paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "payments": {"dataType": "payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "profitAndLoss": {"dataType": "profitAndLoss", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "purchaseOrders": {"dataType": "purchaseOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "salesOrders": {"dataType": "salesOrders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "suppliers": {"dataType": "suppliers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "taxRates": {"dataType": "taxRates", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "trackingCategories": {"dataType": "trackingCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "transfers": {"dataType": "transfers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accountBalances": {"dataType": "banking-accountBalances", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-accounts": {"dataType": "banking-accounts", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactionCategories": {"dataType": "banking-transactionCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "banking-transactions": {"dataType": "banking-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-companyInfo": {"dataType": "commerce-companyInfo", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-customers": {"dataType": "commerce-customers", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-disputes": {"dataType": "commerce-disputes", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-locations": {"dataType": "commerce-locations", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-orders": {"dataType": "commerce-orders", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-paymentMethods": {"dataType": "commerce-paymentMethods", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-payments": {"dataType": "commerce-payments", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-productCategories": {"dataType": "commerce-productCategories", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-products": {"dataType": "commerce-products", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-taxComponents": {"dataType": "commerce-taxComponents", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}, "commerce-transactions": {"dataType": "commerce-transactions", "lastSuccessfulSync": "2022-01-01T00:00:00.000Z", "currentStatus": "Complete", "latestSyncId": "d03b6979-eb3b-447a-a27a-13cf457a9f48", "latestSuccessfulSyncId": "6883bba8-514d-423f-ba7f-c38285a80b7f"}} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - refresh-data-type: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - responses: - "400": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - Unresolved property: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - responses: - "400": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-refresh-data-type: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - dataType: "invoices" - responses: - "200": - application/json: {"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} - "400": - application/json: {} - "500": - application/json: {} - list-pull-operations: - speakeasy-default-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: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - 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: {"results": [{"id": "97d60846-f07a-4d42-b5a0-0bdcc6ebf56b", "companyId": "4645bd78-8988-45bc-ac9e-67ba5df6e4e5", "connectionId": "51baa045-4836-4317-a42e-3542e991e581", "dataType": "invoices", "status": "Initial", "requested": "2022-11-14T11:18:37.2798351Z", "progress": 10, "isCompleted": false, "isErrored": false}], "pageNumber": 0, "pageSize": 0, "totalResults": 0, "_links": {"self": {"href": "/companies/17129e41-5389-4f10-ac06-e0a37e47d177/data/history"}, "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"}}} - 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: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - 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: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-pull-operation: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-pull-operation: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - datasetId: "567094de-cafa-4f13-96d3-59e21b47ebe2" - responses: - "200": - application/json: {"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} - "401": - application/json: {} - "500": - application/json: {} - list-push-operations: - speakeasy-default-list-push-operations: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - 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: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - 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: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-push-operation: - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-get-push-operation: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - pushOperationKey: "86946e36-000f-4e6e-b76f-84a3be88f2b5" - responses: - "200": - application/json: {"changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "e12fb736-33cd-4b97-8d90-32b5be7c8586", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 480134} - "401": - application/json: {} - "500": - application/json: {} - create-account: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"nominalCode": "610", "name": "Accounts Receivable", "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Cash On Hand", "currency": "GBP", "currentBalance": 0, "type": "Asset", "status": "Active"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"nominalCode": "610", "name": "Accounts Receivable", "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Cash On Hand", "currency": "GBP", "currentBalance": 0, "type": "Asset", "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "id": "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", "nominalCode": "610", "name": "Accounts Receivable", "description": "Invoices the business has issued but has not yet collected payment on.", "fullyQualifiedCategory": "Asset.Current", "fullyQualifiedName": "Cash On Hand", "currency": "GBP", "currentBalance": 0, "type": "Asset", "status": "Active"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "936358e8-4e4d-4663-93c0-e27c0d06dd56", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 239266} - "400": - application/json: {} - "500": - application/json: {} - get-create-chartOfAccounts-model: - Exact (Netherlands): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Must be provided."}]}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true, "validation": {"warnings": [], "information": [{"field": "Name", "details": "Must be provided."}]}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "Asset.Assets.Cash", "type": "String", "displayName": "Asset.Assets.Cash", "required": false}, {"value": "Asset.Assets.Bank", "type": "String", "displayName": "Asset.Assets.Bank", "required": false}, {"value": "Asset.Assets.PaymentServices", "type": "String", "displayName": "Asset.Assets.PaymentServices", "required": false}, {"value": "Asset.Assets.AccountsReceivable", "type": "String", "displayName": "Asset.Assets.AccountsReceivable", "required": false}, {"value": "Liability.EquityAndLiabilities.AccountsPayable", "type": "String", "displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false}, {"value": "Asset.Assets.VAT", "type": "String", "displayName": "Asset.Assets.VAT", "required": false}, {"value": "Liability.EquityAndLiabilities.EmployeesPayable", "type": "String", "displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false}, {"value": "Asset.Assets.PrepaidExpenses", "type": "String", "displayName": "Asset.Assets.PrepaidExpenses", "required": false}, {"value": "Liability.EquityAndLiabilities.AccruedExpenses", "type": "String", "displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false}, {"value": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "type": "String", "displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false}, {"value": "Asset.Assets.FixedAssets", "type": "String", "displayName": "Asset.Assets.FixedAssets", "required": false}, {"value": "Asset.Assets.OtherAssets", "type": "String", "displayName": "Asset.Assets.OtherAssets", "required": false}, {"value": "Asset.Assets.AccumulatedDeprecation", "type": "String", "displayName": "Asset.Assets.AccumulatedDeprecation", "required": false}, {"value": "Asset.Assets.Inventory", "type": "String", "displayName": "Asset.Assets.Inventory", "required": false}, {"value": "Equity.EquityAndLiabilities.CapitalStock", "type": "String", "displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false}, {"value": "Equity.EquityAndLiabilities.RetainedEarnings", "type": "String", "displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false}, {"value": "Liability.EquityAndLiabilities.LongTermDebt", "type": "String", "displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false}, {"value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "type": "String", "displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false}, {"value": "Unknown.EquityAndLiabilities.Intercompany", "type": "String", "displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false}, {"value": "Unknown.General.General", "type": "String", "displayName": "Unknown.General.General", "required": false}, {"value": "Income.NetIncome.Revenue", "type": "String", "displayName": "Income.NetIncome.Revenue", "required": false}, {"value": "Expense.NetIncome.CostOfGoods", "type": "String", "displayName": "Expense.NetIncome.CostOfGoods", "required": false}, {"value": "Expense.NetIncome.OtherCosts", "type": "String", "displayName": "Expense.NetIncome.OtherCosts", "required": false}, {"value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "type": "String", "displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false}, {"value": "Expense.NetIncome.DeprecationCosts", "type": "String", "displayName": "Expense.NetIncome.DeprecationCosts", "required": false}, {"value": "Expense.NetIncome.ResearchAndDevelopment", "type": "String", "displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false}, {"value": "Expense.NetIncome.EmployeeCosts", "type": "String", "displayName": "Expense.NetIncome.EmployeeCosts", "required": false}, {"value": "Expense.NetIncome.EmploymentCosts", "type": "String", "displayName": "Expense.NetIncome.EmploymentCosts", "required": false}, {"value": "Expense.ExceptionalIncome.ExceptionalCosts", "type": "String", "displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false}, {"value": "Income.ExceptionalIncome.ExceptionalIncome", "type": "String", "displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false}, {"value": "Expense.ExceptionalIncome.IncomeTaxes", "type": "String", "displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false}, {"value": "Income.ExceptionalIncome.InterestIncome", "type": "String", "displayName": "Income.ExceptionalIncome.InterestIncome", "required": false}], "validation": {"warnings": [], "information": [{"field": "FullyQualifiedCategory", "details": "Must be provided."}]}}, "status": {"type": "String", "displayName": "Account Status", "description": "The status of the account", "required": true, "options": [{"value": "Active", "type": "String", "displayName": "Active", "required": false}, {"value": "Pending", "type": "String", "displayName": "Pending", "required": false}, {"value": "Unknown", "type": "String", "displayName": "Unknown", "required": false}], "validation": {"warnings": [], "information": [{"field": "Status", "details": "Must be provided."}]}}}} - Exact (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Must be provided."}]}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true, "validation": {"warnings": [], "information": [{"field": "Name", "details": "Must be provided."}]}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "Asset.Assets.Cash", "type": "String", "displayName": "Asset.Assets.Cash", "required": false}, {"value": "Asset.Assets.Bank", "type": "String", "displayName": "Asset.Assets.Bank", "required": false}, {"value": "Asset.Assets.PaymentServices", "type": "String", "displayName": "Asset.Assets.PaymentServices", "required": false}, {"value": "Asset.Assets.AccountsReceivable", "type": "String", "displayName": "Asset.Assets.AccountsReceivable", "required": false}, {"value": "Liability.EquityAndLiabilities.AccountsPayable", "type": "String", "displayName": "Liability.EquityAndLiabilities.AccountsPayable", "required": false}, {"value": "Asset.Assets.VAT", "type": "String", "displayName": "Asset.Assets.VAT", "required": false}, {"value": "Liability.EquityAndLiabilities.EmployeesPayable", "type": "String", "displayName": "Liability.EquityAndLiabilities.EmployeesPayable", "required": false}, {"value": "Asset.Assets.PrepaidExpenses", "type": "String", "displayName": "Asset.Assets.PrepaidExpenses", "required": false}, {"value": "Liability.EquityAndLiabilities.AccruedExpenses", "type": "String", "displayName": "Liability.EquityAndLiabilities.AccruedExpenses", "required": false}, {"value": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "type": "String", "displayName": "Liability.EquityAndLiabilities.IncomeTaxesPayable", "required": false}, {"value": "Asset.Assets.FixedAssets", "type": "String", "displayName": "Asset.Assets.FixedAssets", "required": false}, {"value": "Asset.Assets.OtherAssets", "type": "String", "displayName": "Asset.Assets.OtherAssets", "required": false}, {"value": "Asset.Assets.AccumulatedDeprecation", "type": "String", "displayName": "Asset.Assets.AccumulatedDeprecation", "required": false}, {"value": "Asset.Assets.Inventory", "type": "String", "displayName": "Asset.Assets.Inventory", "required": false}, {"value": "Equity.EquityAndLiabilities.CapitalStock", "type": "String", "displayName": "Equity.EquityAndLiabilities.CapitalStock", "required": false}, {"value": "Equity.EquityAndLiabilities.RetainedEarnings", "type": "String", "displayName": "Equity.EquityAndLiabilities.RetainedEarnings", "required": false}, {"value": "Liability.EquityAndLiabilities.LongTermDebt", "type": "String", "displayName": "Liability.EquityAndLiabilities.LongTermDebt", "required": false}, {"value": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "type": "String", "displayName": "Liability.EquityAndLiabilities.CurrentPortionOfDebt", "required": false}, {"value": "Unknown.EquityAndLiabilities.Intercompany", "type": "String", "displayName": "Unknown.EquityAndLiabilities.Intercompany", "required": false}, {"value": "Unknown.General.General", "type": "String", "displayName": "Unknown.General.General", "required": false}, {"value": "Income.NetIncome.Revenue", "type": "String", "displayName": "Income.NetIncome.Revenue", "required": false}, {"value": "Expense.NetIncome.CostOfGoods", "type": "String", "displayName": "Expense.NetIncome.CostOfGoods", "required": false}, {"value": "Expense.NetIncome.OtherCosts", "type": "String", "displayName": "Expense.NetIncome.OtherCosts", "required": false}, {"value": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "type": "String", "displayName": "Expense.NetIncome.SalesGeneralAdministrativeExpenses", "required": false}, {"value": "Expense.NetIncome.DeprecationCosts", "type": "String", "displayName": "Expense.NetIncome.DeprecationCosts", "required": false}, {"value": "Expense.NetIncome.ResearchAndDevelopment", "type": "String", "displayName": "Expense.NetIncome.ResearchAndDevelopment", "required": false}, {"value": "Expense.NetIncome.EmployeeCosts", "type": "String", "displayName": "Expense.NetIncome.EmployeeCosts", "required": false}, {"value": "Expense.NetIncome.EmploymentCosts", "type": "String", "displayName": "Expense.NetIncome.EmploymentCosts", "required": false}, {"value": "Expense.ExceptionalIncome.ExceptionalCosts", "type": "String", "displayName": "Expense.ExceptionalIncome.ExceptionalCosts", "required": false}, {"value": "Income.ExceptionalIncome.ExceptionalIncome", "type": "String", "displayName": "Income.ExceptionalIncome.ExceptionalIncome", "required": false}, {"value": "Expense.ExceptionalIncome.IncomeTaxes", "type": "String", "displayName": "Expense.ExceptionalIncome.IncomeTaxes", "required": false}, {"value": "Income.ExceptionalIncome.InterestIncome", "type": "String", "displayName": "Income.ExceptionalIncome.InterestIncome", "required": false}], "validation": {"warnings": [], "information": [{"field": "FullyQualifiedCategory", "details": "Must be provided."}]}}, "status": {"type": "String", "displayName": "Account Status", "description": "The status of the account", "required": true, "options": [{"value": "Active", "type": "String", "displayName": "Active", "required": false}, {"value": "Pending", "type": "String", "displayName": "Pending", "required": false}, {"value": "Unknown", "type": "String", "displayName": "Unknown", "required": false}], "validation": {"warnings": [], "information": [{"field": "Status", "details": "Must be provided."}]}}}} - MYOB AccountRight and Essentials: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [{"field": "NominalCode", "details": "If alphanumeric is supported, must be between 1 and 10 characters. Otherwise format is x-xxxx"}], "information": []}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": false, "validation": {"warnings": [{"field": "Name", "details": "Must have a length between 1 and 60 characters"}], "information": []}}, "description": {"type": "String", "displayName": "Description", "description": "Description of the account", "required": false, "validation": {"warnings": [{"field": "Description", "details": "Must have a length between 1 and 255 characters"}], "information": []}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "Asset.Bank", "type": "String", "displayName": "Bank", "required": false}, {"value": "Asset.AccountReceivable", "type": "String", "displayName": "Accounts Receivable", "required": false}, {"value": "Asset.OtherCurrentAsset", "type": "String", "displayName": "Other Current Asset", "required": false}, {"value": "Asset.FixedAsset", "type": "String", "displayName": "Fixed Asset", "required": false}, {"value": "Asset.OtherAsset", "type": "String", "displayName": "Other Asset", "required": false}, {"value": "Asset.CashAndBank", "type": "String", "displayName": "Cash", "required": false}, {"value": "Asset.Property Plant and Equipment", "type": "String", "displayName": "Equipment Machinery", "required": false}, {"value": "Liability.CreditCard", "type": "String", "displayName": "Credit Card", "required": false}, {"value": "Liability.AccountsPayable", "type": "String", "displayName": "Accounts Payable", "required": false}, {"value": "Liability.OtherCurrentLiability", "type": "String", "displayName": "Other Current Liability", "required": false}, {"value": "Liability.LongTermLiability", "type": "String", "displayName": "Long Term Liability", "required": false}, {"value": "Liability.OtherLiability", "type": "String", "displayName": "Other Liability", "required": false}, {"value": "Equity", "type": "String", "displayName": "Equity", "required": false}, {"value": "Equity.Equity", "type": "String", "displayName": "Retained Earnings", "required": false}, {"value": "Equity.Equity.RetainedEarnings", "type": "String", "displayName": "Retained Earnings", "required": false}, {"value": "Equity.Owner's Equity", "type": "String", "displayName": "Retained Earnings", "required": false}, {"value": "Income", "type": "String", "displayName": "Income", "required": false}, {"value": "OtherIncome", "type": "String", "displayName": "Other Income", "required": false}, {"value": "Expense", "type": "String", "displayName": "Expense", "required": false}, {"value": "Expense.Expense", "type": "String", "displayName": "Sales Marketing", "required": false}, {"value": "Expense.Expense.Insurance", "type": "String", "displayName": "General Administrative", "required": false}, {"value": "Expense.Overhead", "type": "String", "displayName": "General Administrative", "required": false}, {"value": "Expense.Expense.RepairMaintenance", "type": "String", "displayName": "Repairs Maintenance", "required": false}, {"value": "OtherExpense", "type": "String", "displayName": "Other Expense", "required": false}, {"value": "CostOfSales", "type": "String", "displayName": "Cost of Sales", "required": false}, {"value": "Cost Of Goods Sold.Cost of Sales", "type": "String", "displayName": "Other", "required": false}]}, "status": {"type": "String", "displayName": "Account Status", "description": "The status of the account", "required": true, "options": [{"value": "Active", "type": "String", "displayName": "Active", "required": false}, {"value": "Archived", "type": "String", "displayName": "Archived", "required": false}]}}} - QuickBooks Desktop: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [{"field": "NominalCode", "details": "Max length of 7 characters."}], "information": []}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true, "validation": {"warnings": [{"field": "Name", "details": "Max length of 31 characters."}], "information": []}}, "description": {"type": "String", "displayName": "Description", "description": "Description of the account", "required": false, "validation": {"warnings": [{"field": "Description", "details": "Max length of 200 characters."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the account", "required": false, "validation": {"warnings": [{"field": "Currency", "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."}], "information": [{"field": "Currency", "details": "If not set, will default to the base currency of the QuickBooks Desktop company"}]}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "Asset.AccountsReceivable", "type": "String", "displayName": "Account Receivable", "required": false}, {"value": "Asset.FixedAsset", "type": "String", "displayName": "Fixed Asset", "required": false}, {"value": "Asset.OtherCurrentAsset", "type": "String", "displayName": "Other Current Asset", "required": false}, {"value": "Asset.OtherAsset", "type": "String", "displayName": "Other Asset", "required": false}, {"value": "Income.Income", "type": "String", "displayName": "Income", "required": false}, {"value": "Income.OtherIncome", "type": "String", "displayName": "Other Income", "required": false}, {"value": "Liability.AccountsPayable", "type": "String", "displayName": "Accounts Payable", "required": false}, {"value": "Liability.CreditCard", "type": "String", "displayName": "Credit Card", "required": false}, {"value": "Liability.LongTermLiability", "type": "String", "displayName": "Long Term Liability", "required": false}, {"value": "Liability.OtherCurrentLiability", "type": "String", "displayName": "Other Current Liability", "required": false}, {"value": "Liability.CostOfGoodsSold", "type": "String", "displayName": "Cost Of Goods Sold", "required": false}, {"value": "Equity.Equity", "type": "String", "displayName": "Equity", "required": false}, {"value": "Expense.Expense", "type": "String", "displayName": "Expense", "required": false}, {"value": "Expense.OtherExpense", "type": "String", "displayName": "Other Expense", "required": false}]}, "currentBalance": {"type": "Number", "displayName": "Current Balance", "description": "The current balance in the account", "required": false}}} - QuickBooks Online Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "If included must have a length between 1 and 7 characters"}]}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true, "validation": {"warnings": [{"field": "Name", "details": "Must have a length between 1 and 100 characters"}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the account", "required": false, "validation": {"warnings": [], "information": [{"field": "Currency", "details": "When not specified company base currency will be used"}]}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "Asset.Bank.CashOnHand", "type": "String", "displayName": "Cash On Hand", "required": false}, {"value": "Asset.Bank.Checking", "type": "String", "displayName": "Checking", "required": false}, {"value": "Asset.Bank.MoneyMarket", "type": "String", "displayName": "Money Market", "required": false}, {"value": "Asset.Bank.RentsHeldInTrust", "type": "String", "displayName": "Rents Held In Trust", "required": false}, {"value": "Asset.Bank.Savings", "type": "String", "displayName": "Savings", "required": false}, {"value": "Asset.Bank.TrustAccounts", "type": "String", "displayName": "Trust Accounts", "required": false}, {"value": "Asset.Bank.CashAndCashEquivalents", "type": "String", "displayName": "Cash And Cash Equivalents", "required": false}, {"value": "Asset.Bank.OtherEarmarkedBankAccounts", "type": "String", "displayName": "Other Earmarked Bank Accounts", "required": false}, {"value": "Asset.Other Current Asset.AllowanceForBadDebts", "type": "String", "displayName": "Allowance For Bad Debts", "required": false}, {"value": "Asset.Other Current Asset.DevelopmentCosts", "type": "String", "displayName": "Development Costs", "required": false}, {"value": "Asset.Other Current Asset.EmployeeCashAdvances", "type": "String", "displayName": "Employee Cash Advances", "required": false}, {"value": "Asset.Other Current Asset.OtherCurrentAssets", "type": "String", "displayName": "Other Current Assets", "required": false}, {"value": "Asset.Other Current Asset.Inventory", "type": "String", "displayName": "Inventory", "required": false}, {"value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans", "type": "String", "displayName": "Investment Mortgage Real Estate Loans", "required": false}, {"value": "Asset.Other Current Asset.Investment_Other", "type": "String", "displayName": "Investment Other", "required": false}, {"value": "Asset.Other Current Asset.Investment_TaxExemptSecurities", "type": "String", "displayName": "Investment Tax Exempt Securities", "required": false}, {"value": "Asset.Other Current Asset.Investment_USGovernmentObligations", "type": "String", "displayName": "Investment US Government Obligations", "required": false}, {"value": "Asset.Other Current Asset.LoansToOfficers", "type": "String", "displayName": "Loans To Officers", "required": false}, {"value": "Asset.Other Current Asset.LoansToOthers", "type": "String", "displayName": "Loans To Others", "required": false}, {"value": "Asset.Other Current Asset.LoansToStockholders", "type": "String", "displayName": "Loans To Stockholders", "required": false}, {"value": "Asset.Other Current Asset.PrepaidExpenses", "type": "String", "displayName": "Prepaid Expenses", "required": false}, {"value": "Asset.Other Current Asset.Retainage", "type": "String", "displayName": "Retainage", "required": false}, {"value": "Asset.Other Current Asset.UndepositedFunds", "type": "String", "displayName": "Undeposited Funds", "required": false}, {"value": "Asset.Other Current Asset.AssetsAvailableForSale", "type": "String", "displayName": "Assets Available For Sale", "required": false}, {"value": "Asset.Other Current Asset.BalWithGovtAuthorities", "type": "String", "displayName": "Balance With Govt Authorities", "required": false}, {"value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid", "type": "String", "displayName": "Called Up Share Capital Not Paid", "required": false}, {"value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit", "type": "String", "displayName": "Expenditure Authorisations And Letters Of Credit", "required": false}, {"value": "Asset.Other Current Asset.GlobalTaxDeferred", "type": "String", "displayName": "Global Tax Deferred", "required": false}, {"value": "Asset.Other Current Asset.GlobalTaxRefund", "type": "String", "displayName": "Global Tax Refund", "required": false}, {"value": "Asset.Other Current Asset.InternalTransfers", "type": "String", "displayName": "Internal Transfers", "required": false}, {"value": "Asset.Other Current Asset.OtherConsumables", "type": "String", "displayName": "Other Consumables", "required": false}, {"value": "Asset.Other Current Asset.ProvisionsCurrentAssets", "type": "String", "displayName": "Provisions Current Assets", "required": false}, {"value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties", "type": "String", "displayName": "Short Term Investments In Related Parties", "required": false}, {"value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties", "type": "String", "displayName": "Short Term Loans And Advances To Related Parties", "required": false}, {"value": "Asset.Other Current Asset.TradeAndOtherReceivables", "type": "String", "displayName": "Trade And Other Receivables", "required": false}, {"value": "Asset.Fixed Asset.AccumulatedDepletion", "type": "String", "displayName": "Accumulated Depletion", "required": false}, {"value": "Asset.Fixed Asset.AccumulatedDepreciation", "type": "String", "displayName": "Accumulated Depreciation", "required": false}, {"value": "Asset.Fixed Asset.DepletableAssets", "type": "String", "displayName": "Depletable Assets", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetComputers", "type": "String", "displayName": "Fixed Asset Computers", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetCopiers", "type": "String", "displayName": "Fixed Asset Copiers", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetFurniture", "type": "String", "displayName": "Fixed Asset Furniture", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetPhone", "type": "String", "displayName": "Fixed Asset Phone", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetPhotoVideo", "type": "String", "displayName": "Fixed Asset Photo Video", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetSoftware", "type": "String", "displayName": "Fixed Asset Software", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment", "type": "String", "displayName": "Fixed Asset Other Tools Equipment", "required": false}, {"value": "Asset.Fixed Asset.FurnitureAndFixtures", "type": "String", "displayName": "Furniture And Fixtures", "required": false}, {"value": "Asset.Fixed Asset.Land", "type": "String", "displayName": "Land", "required": false}, {"value": "Asset.Fixed Asset.LeaseholdImprovements", "type": "String", "displayName": "Leasehold Improvements", "required": false}, {"value": "Asset.Fixed Asset.OtherFixedAssets", "type": "String", "displayName": "Other Fixed Assets", "required": false}, {"value": "Asset.Fixed Asset.AccumulatedAmortization", "type": "String", "displayName": "Accumulated Amortization", "required": false}, {"value": "Asset.Fixed Asset.Buildings", "type": "String", "displayName": "Buildings", "required": false}, {"value": "Asset.Fixed Asset.IntangibleAssets", "type": "String", "displayName": "Intangible Assets", "required": false}, {"value": "Asset.Fixed Asset.MachineryAndEquipment", "type": "String", "displayName": "Machinery And Equipment", "required": false}, {"value": "Asset.Fixed Asset.Vehicles", "type": "String", "displayName": "Vehicles", "required": false}, {"value": "Asset.Fixed Asset.AssetsInCourseOfConstruction", "type": "String", "displayName": "Assets In Course Of Construction", "required": false}, {"value": "Asset.Fixed Asset.CapitalWip", "type": "String", "displayName": "Capital Wip", "required": false}, {"value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets", "type": "String", "displayName": "Cumulative Depreciation On Intangible Assets", "required": false}, {"value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment", "type": "String", "displayName": "Intangible Assets Under Development", "required": false}, {"value": "Asset.Fixed Asset.LandAsset", "type": "String", "displayName": "Land Asset", "required": false}, {"value": "Asset.Fixed Asset.NonCurrentAssets", "type": "String", "displayName": "Non Current Assets", "required": false}, {"value": "Asset.Fixed Asset.ParticipatingInterests", "type": "String", "displayName": "Participating Interests", "required": false}, {"value": "Asset.Fixed Asset.ProvisionsFixedAssets", "type": "String", "displayName": "Provisions Fixed Assets", "required": false}, {"value": "Asset.Other Asset.LeaseBuyout", "type": "String", "displayName": "Lease Buyout", "required": false}, {"value": "Asset.Other Asset.OtherLongTermAssets", "type": "String", "displayName": "Other Long Term Assets", "required": false}, {"value": "Asset.Other Asset.SecurityDeposits", "type": "String", "displayName": "Security Deposits", "required": false}, {"value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets", "type": "String", "displayName": "Accumulated Amortization Of Other Assets", "required": false}, {"value": "Asset.Other Asset.Goodwill", "type": "String", "displayName": "Goodwill", "required": false}, {"value": "Asset.Other Asset.Licenses", "type": "String", "displayName": "Licenses", "required": false}, {"value": "Asset.Other Asset.OrganizationalCosts", "type": "String", "displayName": "Organizational Costs", "required": false}, {"value": "Asset.Other Asset.AssetsHeldForSale", "type": "String", "displayName": "Assets Held For Sale", "required": false}, {"value": "Asset.Other Asset.AvailableForSaleFinancialAssets", "type": "String", "displayName": "Available For Sale Financial Assets", "required": false}, {"value": "Asset.Other Asset.DeferredTax", "type": "String", "displayName": "Deferred Tax", "required": false}, {"value": "Asset.Other Asset.Investments", "type": "String", "displayName": "Investments", "required": false}, {"value": "Asset.Other Asset.LongTermInvestments", "type": "String", "displayName": "Long Term Investments", "required": false}, {"value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties", "type": "String", "displayName": "Long Term Loans And Advances To Related Parties", "required": false}, {"value": "Asset.Other Asset.OtherIntangibleAssets", "type": "String", "displayName": "Other Intangible Assets", "required": false}, {"value": "Asset.Other Asset.OtherLongTermInvestments", "type": "String", "displayName": "Other Long Term Investments", "required": false}, {"value": "Asset.Other Asset.OtherLongTermLoansAndAdvances", "type": "String", "displayName": "Other Long Term Loans And Advances", "required": false}, {"value": "Asset.Other Asset.PrepaymentsAndAccruedIncome", "type": "String", "displayName": "Prepayments And Accrued Income", "required": false}, {"value": "Asset.Other Asset.ProvisionsNonCurrentAssets", "type": "String", "displayName": "Provisions Non-Current Assets", "required": false}, {"value": "Asset.Accounts Receivable.AccountsReceivable", "type": "String", "displayName": "Accounts Receivable", "required": false}, {"value": "Expense.Expense.AdvertisingPromotional", "type": "String", "displayName": "Advertising/Promotional", "required": false}, {"value": "Expense.Expense.BadDebts", "type": "String", "displayName": "Bad Debts", "required": false}, {"value": "Expense.Expense.BankCharges", "type": "String", "displayName": "Bank Charges", "required": false}, {"value": "Expense.Expense.CharitableContributions", "type": "String", "displayName": "Charitable Contributions", "required": false}, {"value": "Expense.Expense.CommissionsAndFees", "type": "String", "displayName": "Commissions And Fees", "required": false}, {"value": "Expense.Expense.Entertainment", "type": "String", "displayName": "Entertainment", "required": false}, {"value": "Expense.Expense.EntertainmentMeals", "type": "String", "displayName": "Entertainment Meals", "required": false}, {"value": "Expense.Expense.EquipmentRental", "type": "String", "displayName": "Equipment Rental", "required": false}, {"value": "Expense.Expense.FinanceCosts", "type": "String", "displayName": "Finance Costs", "required": false}, {"value": "Expense.Expense.GlobalTaxExpense", "type": "String", "displayName": "Global Tax Expense", "required": false}, {"value": "Expense.Expense.Insurance", "type": "String", "displayName": "Insurance", "required": false}, {"value": "Expense.Expense.InterestPaid", "type": "String", "displayName": "Interest Paid", "required": false}, {"value": "Expense.Expense.LegalProfessionalFees", "type": "String", "displayName": "Legal And Professional Fees", "required": false}, {"value": "Expense.Expense.OfficeExpenses", "type": "String", "displayName": "Office Expenses", "required": false}, {"value": "Expense.Expense.OfficeGeneralAdministrativeExpenses", "type": "String", "displayName": "Office/General Administrative Expenses", "required": false}, {"value": "Expense.Expense.OtherBusinessExpenses", "type": "String", "displayName": "Other Business Expenses", "required": false}, {"value": "Expense.Expense.OtherMiscellaneousServiceCost", "type": "String", "displayName": "Other Miscellaneous Service Cost", "required": false}, {"value": "Expense.Expense.PromotionalMeals", "type": "String", "displayName": "Promotional Meals", "required": false}, {"value": "Expense.Expense.RentOrLeaseOfBuildings", "type": "String", "displayName": "Rent Or Lease Of Buildings", "required": false}, {"value": "Expense.Expense.RepairMaintenance", "type": "String", "displayName": "Repair And Maintenance", "required": false}, {"value": "Expense.Expense.ShippingFreightDelivery", "type": "String", "displayName": "Shipping, Freight And Delivery", "required": false}, {"value": "Expense.Expense.SuppliesMaterials", "type": "String", "displayName": "Supplies And Materials", "required": false}, {"value": "Expense.Expense.Travel", "type": "String", "displayName": "Travel", "required": false}, {"value": "Expense.Expense.TravelMeals", "type": "String", "displayName": "Travel Meals", "required": false}, {"value": "Expense.Expense.Utilities", "type": "String", "displayName": "Utilities", "required": false}, {"value": "Expense.Expense.Auto", "type": "String", "displayName": "Auto", "required": false}, {"value": "Expense.Expense.CostOfLabor", "type": "String", "displayName": "Cost Of Labor", "required": false}, {"value": "Expense.Expense.DuesSubscriptions", "type": "String", "displayName": "Dues And Subscriptions", "required": false}, {"value": "Expense.Expense.PayrollExpenses", "type": "String", "displayName": "Payroll Expenses", "required": false}, {"value": "Expense.Expense.TaxesPaid", "type": "String", "displayName": "Taxes Paid", "required": false}, {"value": "Expense.Expense.UnappliedCashBillPaymentExpense", "type": "String", "displayName": "Unapplied Cash Bill Payment Expense", "required": false}, {"value": "Expense.Expense.Utilities", "type": "String", "displayName": "Utilities", "required": false}, {"value": "Expense.Expense.AmortizationExpense", "type": "String", "displayName": "Amortization Expense", "required": false}, {"value": "Expense.Expense.AppropriationsToDepreciation", "type": "String", "displayName": "Appropriations To Depreciation", "required": false}, {"value": "Expense.Expense.BorrowingCost", "type": "String", "displayName": "Borrowing Cost", "required": false}, {"value": "Expense.Expense.CommissionsAndFees", "type": "String", "displayName": "Commissions And Fees", "required": false}, {"value": "Expense.Expense.DistributionCosts", "type": "String", "displayName": "Distribution Costs", "required": false}, {"value": "Expense.Expense.ExternalServices", "type": "String", "displayName": "External Services", "required": false}, {"value": "Expense.Expense.ExtraordinaryCharges", "type": "String", "displayName": "Extraordinary Charges", "required": false}, {"value": "Expense.Expense.IncomeTaxExpense", "type": "String", "displayName": "Income Tax Expense", "required": false}, {"value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax", "type": "String", "displayName": "Loss On Discontinued Operations Net Of Tax", "required": false}, {"value": "Expense.Expense.ManagementCompensation", "type": "String", "displayName": "Management Compensation", "required": false}, {"value": "Expense.Expense.OtherCurrentOperatingCharges", "type": "String", "displayName": "Other Current Operating Charges", "required": false}, {"value": "Expense.Expense.OtherExternalServices", "type": "String", "displayName": "Other External Services", "required": false}, {"value": "Expense.Expense.OtherRentalCosts", "type": "String", "displayName": "Other Rental Costs", "required": false}, {"value": "Expense.Expense.OtherSellingExpenses", "type": "String", "displayName": "Other Selling Expenses", "required": false}, {"value": "Expense.Expense.ProjectStudiesSurveysAssessments", "type": "String", "displayName": "Project Studies Surveys Assessments", "required": false}, {"value": "Expense.Expense.PurchasesRebates", "type": "String", "displayName": "Purchases Rebates", "required": false}, {"value": "Expense.Expense.ShippingAndDeliveryExpense", "type": "String", "displayName": "Shipping And Delivery Expense", "required": false}, {"value": "Expense.Expense.StaffCosts", "type": "String", "displayName": "Staff Costs", "required": false}, {"value": "Expense.Expense.Sundry", "type": "String", "displayName": "Sundry", "required": false}, {"value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses", "type": "String", "displayName": "Travel Expenses General And Admin Expenses", "required": false}, {"value": "Expense.Expense.TravelExpensesSellingExpense", "type": "String", "displayName": "Travel Expenses Selling Expense", "required": false}, {"value": "Expense.Other Expense.Depreciation", "type": "String", "displayName": "Depreciation", "required": false}, {"value": "Expense.Other Expense.ExchangeGainOrLoss", "type": "String", "displayName": "Exchange Gain Or Loss", "required": false}, {"value": "Expense.Other Expense.OtherMiscellaneousExpense", "type": "String", "displayName": "Other Miscellaneous Expense", "required": false}, {"value": "Expense.Other Expense.PenaltiesSettlements", "type": "String", "displayName": "Penalties And Settlements", "required": false}, {"value": "Expense.Other Expense.Amortization", "type": "String", "displayName": "Amortization", "required": false}, {"value": "Expense.Other Expense.GasAndFuel", "type": "String", "displayName": "Gas And Fuel", "required": false}, {"value": "Expense.Other Expense.HomeOffice", "type": "String", "displayName": "Home Office", "required": false}, {"value": "Expense.Other Expense.HomeOwnerRentalInsurance", "type": "String", "displayName": "Home Owner Rental Insurance", "required": false}, {"value": "Expense.Other Expense.OtherHomeOfficeExpenses", "type": "String", "displayName": "Other Home Office Expenses", "required": false}, {"value": "Expense.Other Expense.MortgageInterest", "type": "String", "displayName": "Mortgage Interest", "required": false}, {"value": "Expense.Other Expense.RentAndLease", "type": "String", "displayName": "Rent And Lease", "required": false}, {"value": "Expense.Other Expense.RepairsAndMaintenance", "type": "String", "displayName": "Repairs And Maintenance", "required": false}, {"value": "Expense.Other Expense.ParkingAndTolls", "type": "String", "displayName": "Parking And Tolls", "required": false}, {"value": "Expense.Other Expense.Vehicle", "type": "String", "displayName": "Vehicle", "required": false}, {"value": "Expense.Other Expense.VehicleInsurance", "type": "String", "displayName": "Vehicle Insurance", "required": false}, {"value": "Expense.Other Expense.VehicleLease", "type": "String", "displayName": "Vehicle Lease", "required": false}, {"value": "Expense.Other Expense.VehicleLoanInterest", "type": "String", "displayName": "Vehicle Loan Interest", "required": false}, {"value": "Expense.Other Expense.VehicleLoan", "type": "String", "displayName": "Vehicle Loan", "required": false}, {"value": "Expense.Other Expense.VehicleRegistration", "type": "String", "displayName": "Vehicle Registration", "required": false}, {"value": "Expense.Other Expense.VehicleRepairs", "type": "String", "displayName": "Vehicle Repairs", "required": false}, {"value": "Expense.Other Expense.OtherVehicleExpenses", "type": "String", "displayName": "Other Vehicle Expenses", "required": false}, {"value": "Expense.Other Expense.Utilities", "type": "String", "displayName": "Utilities", "required": false}, {"value": "Expense.Other Expense.WashAndRoadServices", "type": "String", "displayName": "Wash And Road Services", "required": false}, {"value": "Expense.Other Expense.DeferredTaxExpense", "type": "String", "displayName": "Deferred Tax Expense", "required": false}, {"value": "Expense.Other Expense.Depletion", "type": "String", "displayName": "Depletion", "required": false}, {"value": "Expense.Other Expense.ExceptionalItems", "type": "String", "displayName": "Exceptional Items", "required": false}, {"value": "Expense.Other Expense.ExtraordinaryItems", "type": "String", "displayName": "Extraordinary Items", "required": false}, {"value": "Expense.Other Expense.IncomeTaxOtherExpense", "type": "String", "displayName": "Income Tax Other Expense", "required": false}, {"value": "Expense.Other Expense.MatCredit", "type": "String", "displayName": "Mat Credit", "required": false}, {"value": "Expense.Other Expense.PriorPeriodItems", "type": "String", "displayName": "Prior Period Items", "required": false}, {"value": "Expense.Other Expense.TaxRoundoffGainOrLoss", "type": "String", "displayName": "Tax Roundoff Gain Or Loss", "required": false}, {"value": "Expense.Cost of Goods Sold.EquipmentRentalCos", "type": "String", "displayName": "Equipment Rental - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos", "type": "String", "displayName": "Other Costs Of Sales - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos", "type": "String", "displayName": "Shipping, Freight And Delivery - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs", "type": "String", "displayName": "Supplies And Materials - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.CostOfLaborCos", "type": "String", "displayName": "Cost Of Labor - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.CostOfSales", "type": "String", "displayName": "Cost Of Sales", "required": false}, {"value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost", "type": "String", "displayName": "Freight And Delivery Cost", "required": false}, {"value": "Income.Income.NonProfitIncome", "type": "String", "displayName": "Non Profit Income", "required": false}, {"value": "Income.Income.OtherPrimaryIncome", "type": "String", "displayName": "Other Primary Income", "required": false}, {"value": "Income.Income.SalesOfProductIncome", "type": "String", "displayName": "Sales Of ProductIncome", "required": false}, {"value": "Income.Income.ServiceFeeIncome", "type": "String", "displayName": "Service Fee Income", "required": false}, {"value": "Income.Income.DiscountsRefundsGiven", "type": "String", "displayName": "Discounts Refunds Given", "required": false}, {"value": "Income.Income.UnappliedCashPaymentIncome", "type": "String", "displayName": "Unapplied Cash Payment Income", "required": false}, {"value": "Income.Income.CashReceiptIncome", "type": "String", "displayName": "Cash Receipt Income", "required": false}, {"value": "Income.Income.OperatingGrants", "type": "String", "displayName": "Operating Grants", "required": false}, {"value": "Income.Income.OtherCurrentOperatingIncome", "type": "String", "displayName": "Other Current Operating Income", "required": false}, {"value": "Income.Income.OwnWorkCapitalized", "type": "String", "displayName": "Own Work Capitalized", "required": false}, {"value": "Income.Income.RevenueGeneral", "type": "String", "displayName": "Revenue General", "required": false}, {"value": "Income.Income.SalesRetail", "type": "String", "displayName": "Sales Retail", "required": false}, {"value": "Income.Income.SalesWholesale", "type": "String", "displayName": "Sales Wholesale", "required": false}, {"value": "Income.Income.SavingsByTaxScheme", "type": "String", "displayName": "Savings By Tax Scheme", "required": false}, {"value": "Income.Other Income.DividendIncome", "type": "String", "displayName": "Dividend Income", "required": false}, {"value": "Income.Other Income.InterestEarned", "type": "String", "displayName": "Interest Earned", "required": false}, {"value": "Income.Other Income.OtherInvestmentIncome", "type": "String", "displayName": "Other Investment Income", "required": false}, {"value": "Income.Other Income.OtherMiscellaneousIncome", "type": "String", "displayName": "Other Miscellaneous Income", "required": false}, {"value": "Income.Other Income.TaxExemptInterest", "type": "String", "displayName": "Tax Exempt Interest", "required": false}, {"value": "Income.Other Income.GainLossOnSaleOfFixedAssets", "type": "String", "displayName": "Gain Loss On Sale Of Fixed Assets", "required": false}, {"value": "Income.Other Income.GainLossOnSaleOfInvestments", "type": "String", "displayName": "Gain Loss On Sale Of Investments", "required": false}, {"value": "Income.Other Income.LossOnDisposalOfAssets", "type": "String", "displayName": "Loss On Disposal Of Assets", "required": false}, {"value": "Income.Other Income.OtherOperatingIncome", "type": "String", "displayName": "Other Operating Income", "required": false}, {"value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax", "type": "String", "displayName": "Unrealised Loss On Securities Net Of Tax", "required": false}, {"value": "Liability.Accounts Payable.AccountsPayable", "type": "String", "displayName": "Accounts Payable", "required": false}, {"value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise", "type": "String", "displayName": "Outstanding Dues Micro Small Enterprise", "required": false}, {"value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise", "type": "String", "displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false}, {"value": "Liability.Credit Card.CreditCard", "type": "String", "displayName": "Credit Card", "required": false}, {"value": "Liability.Long Term Liability.NotesPayable", "type": "String", "displayName": "Notes Payable", "required": false}, {"value": "Liability.Long Term Liability.OtherLongTermLiabilities", "type": "String", "displayName": "Other Long Term Liabilities", "required": false}, {"value": "Liability.Long Term Liability.ShareholderNotesPayable", "type": "String", "displayName": "Shareholder Notes Payable", "required": false}, {"value": "Liability.Long Term Liability.AccrualsAndDeferredIncome", "type": "String", "displayName": "Accruals And Deferred Income", "required": false}, {"value": "Liability.Long Term Liability.AccruedLongLermLiabilities", "type": "String", "displayName": "Accrued Long Lerm Liabilities", "required": false}, {"value": "Liability.Long Term Liability.AccruedVacationPayable", "type": "String", "displayName": "Accrued Vacation Payable", "required": false}, {"value": "Liability.Long Term Liability.BankLoans", "type": "String", "displayName": "Bank Loans", "required": false}, {"value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests", "type": "String", "displayName": "Debts Related To Participating Interests", "required": false}, {"value": "Liability.Long Term Liability.DeferredTaxLiabilities", "type": "String", "displayName": "Deferred Tax Liabilities", "required": false}, {"value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities", "type": "String", "displayName": "Government And Other Public Authorities", "required": false}, {"value": "Liability.Long Term Liability.GroupAndAssociates", "type": "String", "displayName": "Group And Associates", "required": false}, {"value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale", "type": "String", "displayName": "Liabilities Related To Assets Held For Sale", "required": false}, {"value": "Liability.Long Term Liability.LongTermBorrowings", "type": "String", "displayName": "Long Term Borrowings", "required": false}, {"value": "Liability.Long Term Liability.LongTermDebit", "type": "String", "displayName": "Long Term Debit", "required": false}, {"value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations", "type": "String", "displayName": "Long Term Employee Benefit Obligations", "required": false}, {"value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases", "type": "String", "displayName": "Obligations Under Finance Leases", "required": false}, {"value": "Liability.Long Term Liability.OtherLongTermProvisions", "type": "String", "displayName": "Other Long Term Provisions", "required": false}, {"value": "Liability.Long Term Liability.ProvisionForLiabilities", "type": "String", "displayName": "Provision For Liabilities", "required": false}, {"value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities", "type": "String", "displayName": "Provisions Non Current Liabilities", "required": false}, {"value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts", "type": "String", "displayName": "Staff And Related Long Term Liability Accounts", "required": false}, {"value": "Liability.Other Current Liability.DirectDepositPayable", "type": "String", "displayName": "Direct Deposit Payable", "required": false}, {"value": "Liability.Other Current Liability.LineOfCredit", "type": "String", "displayName": "Line Of Credit", "required": false}, {"value": "Liability.Other Current Liability.LoanPayable", "type": "String", "displayName": "Loan Payable", "required": false}, {"value": "Liability.Other Current Liability.GlobalTaxPayable", "type": "String", "displayName": "Global Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.GlobalTaxSuspense", "type": "String", "displayName": "Global Tax Suspense", "required": false}, {"value": "Liability.Other Current Liability.OtherCurrentLiabilities", "type": "String", "displayName": "Other Current Liabilities", "required": false}, {"value": "Liability.Other Current Liability.PayrollClearing", "type": "String", "displayName": "Payroll Clearing", "required": false}, {"value": "Liability.Other Current Liability.PayrollTaxPayable", "type": "String", "displayName": "Payroll Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.PrepaidExpensesPayable", "type": "String", "displayName": "Prepaid Expenses Payable", "required": false}, {"value": "Liability.Other Current Liability.RentsInTrustLiability", "type": "String", "displayName": "Rents In Trust Liability", "required": false}, {"value": "Liability.Other Current Liability.TrustAccountsLiabilities", "type": "String", "displayName": "Trust Accounts Liabilities", "required": false}, {"value": "Liability.Other Current Liability.FederalIncomeTaxPayable", "type": "String", "displayName": "Federal Income Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.InsurancePayable", "type": "String", "displayName": "Insurance Payable", "required": false}, {"value": "Liability.Other Current Liability.SalesTaxPayable", "type": "String", "displayName": "Sales Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable", "type": "String", "displayName": "State Local Income Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.AccruedLiabilities", "type": "String", "displayName": "Accrued Liabilities", "required": false}, {"value": "Liability.Other Current Liability.CurrentLiabilities", "type": "String", "displayName": "Current Liabilities", "required": false}, {"value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations", "type": "String", "displayName": "Current Portion EmployeeBenefits Obligations", "required": false}, {"value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases", "type": "String", "displayName": "Current Portion Of Obligations Under Finance Leases", "required": false}, {"value": "Liability.Other Current Liability.CurrentTaxLiability", "type": "String", "displayName": "Current Tax Liability", "required": false}, {"value": "Liability.Other Current Liability.DividendsPayable", "type": "String", "displayName": "Dividends Payable", "required": false}, {"value": "Liability.Other Current Liability.DutiesAndTaxes", "type": "String", "displayName": "Duties And Taxes", "required": false}, {"value": "Liability.Other Current Liability.InterestPayables", "type": "String", "displayName": "Interest Payables", "required": false}, {"value": "Liability.Other Current Liability.ProvisionForWarrantyObligations", "type": "String", "displayName": "Provision For Warranty Obligations", "required": false}, {"value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities", "type": "String", "displayName": "Provisions Current Liabilities", "required": false}, {"value": "Liability.Other Current Liability.ShortTermBorrowings", "type": "String", "displayName": "Short Term Borrowings", "required": false}, {"value": "Liability.Other Current Liability.SocialSecurityAgencies", "type": "String", "displayName": "Social Security Agencies", "required": false}, {"value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts", "type": "String", "displayName": "Staff And Related Liability Accounts", "required": false}, {"value": "Liability.Other Current Liability.SundryDebtorsAndCreditors", "type": "String", "displayName": "Sundry Debtors And Creditors", "required": false}, {"value": "Liability.Other Current Liability.TradeAndOtherPayables", "type": "String", "displayName": "Trade And Other Payables", "required": false}, {"value": "Equity.Equity.OpeningBalanceEquity", "type": "String", "displayName": "Opening Balance Equity", "required": false}, {"value": "Equity.Equity.PartnersEquity", "type": "String", "displayName": "Partners Equity", "required": false}, {"value": "Equity.Equity.RetainedEarnings", "type": "String", "displayName": "Retained Earnings", "required": false}, {"value": "Equity.Equity.AccumulatedAdjustment", "type": "String", "displayName": "Accumulated Adjustment", "required": false}, {"value": "Equity.Equity.OwnersEquity", "type": "String", "displayName": "Owners Equity", "required": false}, {"value": "Equity.Equity.PaidInCapitalOrSurplus", "type": "String", "displayName": "Paid In Capital Or Surplus", "required": false}, {"value": "Equity.Equity.PartnerContributions", "type": "String", "displayName": "Partner Contributions", "required": false}, {"value": "Equity.Equity.PartnerDistributions", "type": "String", "displayName": "Partner Distributions", "required": false}, {"value": "Equity.Equity.PreferredStock", "type": "String", "displayName": "Preferred Stock", "required": false}, {"value": "Equity.Equity.CommonStock", "type": "String", "displayName": "Common Stock", "required": false}, {"value": "Equity.Equity.TreasuryStock", "type": "String", "displayName": "Treasury Stock", "required": false}, {"value": "Equity.Equity.EstimatedTaxes", "type": "String", "displayName": "Estimated Taxes", "required": false}, {"value": "Equity.Equity.Healthcare", "type": "String", "displayName": "Healthcare", "required": false}, {"value": "Equity.Equity.PersonalIncome", "type": "String", "displayName": "Personal Income", "required": false}, {"value": "Equity.Equity.PersonalExpense", "type": "String", "displayName": "Personal Expense", "required": false}, {"value": "Equity.Equity.AccumulatedOtherComprehensiveIncome", "type": "String", "displayName": "Accumulated Other Comprehensive Income", "required": false}, {"value": "Equity.Equity.CalledUpShareCapital", "type": "String", "displayName": "Called Up Share Capital", "required": false}, {"value": "Equity.Equity.CapitalReserves", "type": "String", "displayName": "Capital Reserves", "required": false}, {"value": "Equity.Equity.DividendDisbursed", "type": "String", "displayName": "Dividend Disbursed", "required": false}, {"value": "Equity.Equity.EquityInEarningsOfSubsiduaries", "type": "String", "displayName": "Equity In Earnings Of Subsiduaries", "required": false}, {"value": "Equity.Equity.InvestmentGrants", "type": "String", "displayName": "Investment Grants", "required": false}, {"value": "Equity.Equity.MoneyReceivedAgainstShareWarrants", "type": "String", "displayName": "Money Received Against Share Warrants", "required": false}, {"value": "Equity.Equity.OtherFreeReserves", "type": "String", "displayName": "Other Free Reserves", "required": false}, {"value": "Equity.Equity.ShareApplicationMoneyPendingAllotment", "type": "String", "displayName": "Share Application Money Pending Allotment", "required": false}, {"value": "Equity.Equity.ShareCapital", "type": "String", "displayName": "Share Capital", "required": false}, {"value": "Equity.Equity.Funds", "type": "String", "displayName": "Funds", "required": false}]}}} - QuickBooks Online: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "If included must have a length between 1 and 7 characters"}]}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true, "validation": {"warnings": [{"field": "Name", "details": "Must have a length between 1 and 100 characters"}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the account", "required": false, "validation": {"warnings": [], "information": [{"field": "Currency", "details": "When not specified company base currency will be used"}]}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "Asset.Bank.CashOnHand", "type": "String", "displayName": "Cash On Hand", "required": false}, {"value": "Asset.Bank.Checking", "type": "String", "displayName": "Checking", "required": false}, {"value": "Asset.Bank.MoneyMarket", "type": "String", "displayName": "Money Market", "required": false}, {"value": "Asset.Bank.RentsHeldInTrust", "type": "String", "displayName": "Rents Held In Trust", "required": false}, {"value": "Asset.Bank.Savings", "type": "String", "displayName": "Savings", "required": false}, {"value": "Asset.Bank.TrustAccounts", "type": "String", "displayName": "Trust Accounts", "required": false}, {"value": "Asset.Bank.CashAndCashEquivalents", "type": "String", "displayName": "Cash And Cash Equivalents", "required": false}, {"value": "Asset.Bank.OtherEarmarkedBankAccounts", "type": "String", "displayName": "Other Earmarked Bank Accounts", "required": false}, {"value": "Asset.Other Current Asset.AllowanceForBadDebts", "type": "String", "displayName": "Allowance For Bad Debts", "required": false}, {"value": "Asset.Other Current Asset.DevelopmentCosts", "type": "String", "displayName": "Development Costs", "required": false}, {"value": "Asset.Other Current Asset.EmployeeCashAdvances", "type": "String", "displayName": "Employee Cash Advances", "required": false}, {"value": "Asset.Other Current Asset.OtherCurrentAssets", "type": "String", "displayName": "Other Current Assets", "required": false}, {"value": "Asset.Other Current Asset.Inventory", "type": "String", "displayName": "Inventory", "required": false}, {"value": "Asset.Other Current Asset.Investment_MortgageRealEstateLoans", "type": "String", "displayName": "Investment Mortgage Real Estate Loans", "required": false}, {"value": "Asset.Other Current Asset.Investment_Other", "type": "String", "displayName": "Investment Other", "required": false}, {"value": "Asset.Other Current Asset.Investment_TaxExemptSecurities", "type": "String", "displayName": "Investment Tax Exempt Securities", "required": false}, {"value": "Asset.Other Current Asset.Investment_USGovernmentObligations", "type": "String", "displayName": "Investment US Government Obligations", "required": false}, {"value": "Asset.Other Current Asset.LoansToOfficers", "type": "String", "displayName": "Loans To Officers", "required": false}, {"value": "Asset.Other Current Asset.LoansToOthers", "type": "String", "displayName": "Loans To Others", "required": false}, {"value": "Asset.Other Current Asset.LoansToStockholders", "type": "String", "displayName": "Loans To Stockholders", "required": false}, {"value": "Asset.Other Current Asset.PrepaidExpenses", "type": "String", "displayName": "Prepaid Expenses", "required": false}, {"value": "Asset.Other Current Asset.Retainage", "type": "String", "displayName": "Retainage", "required": false}, {"value": "Asset.Other Current Asset.UndepositedFunds", "type": "String", "displayName": "Undeposited Funds", "required": false}, {"value": "Asset.Other Current Asset.AssetsAvailableForSale", "type": "String", "displayName": "Assets Available For Sale", "required": false}, {"value": "Asset.Other Current Asset.BalWithGovtAuthorities", "type": "String", "displayName": "Balance With Govt Authorities", "required": false}, {"value": "Asset.Other Current Asset.CalledUpShareCapitalNotPaid", "type": "String", "displayName": "Called Up Share Capital Not Paid", "required": false}, {"value": "Asset.Other Current Asset.ExpenditureAuthorisationsAndLettersOfCredit", "type": "String", "displayName": "Expenditure Authorisations And Letters Of Credit", "required": false}, {"value": "Asset.Other Current Asset.GlobalTaxDeferred", "type": "String", "displayName": "Global Tax Deferred", "required": false}, {"value": "Asset.Other Current Asset.GlobalTaxRefund", "type": "String", "displayName": "Global Tax Refund", "required": false}, {"value": "Asset.Other Current Asset.InternalTransfers", "type": "String", "displayName": "Internal Transfers", "required": false}, {"value": "Asset.Other Current Asset.OtherConsumables", "type": "String", "displayName": "Other Consumables", "required": false}, {"value": "Asset.Other Current Asset.ProvisionsCurrentAssets", "type": "String", "displayName": "Provisions Current Assets", "required": false}, {"value": "Asset.Other Current Asset.ShortTermInvestmentsInRelatedParties", "type": "String", "displayName": "Short Term Investments In Related Parties", "required": false}, {"value": "Asset.Other Current Asset.ShortTermLoansAndAdvancesToRelatedParties", "type": "String", "displayName": "Short Term Loans And Advances To Related Parties", "required": false}, {"value": "Asset.Other Current Asset.TradeAndOtherReceivables", "type": "String", "displayName": "Trade And Other Receivables", "required": false}, {"value": "Asset.Fixed Asset.AccumulatedDepletion", "type": "String", "displayName": "Accumulated Depletion", "required": false}, {"value": "Asset.Fixed Asset.AccumulatedDepreciation", "type": "String", "displayName": "Accumulated Depreciation", "required": false}, {"value": "Asset.Fixed Asset.DepletableAssets", "type": "String", "displayName": "Depletable Assets", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetComputers", "type": "String", "displayName": "Fixed Asset Computers", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetCopiers", "type": "String", "displayName": "Fixed Asset Copiers", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetFurniture", "type": "String", "displayName": "Fixed Asset Furniture", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetPhone", "type": "String", "displayName": "Fixed Asset Phone", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetPhotoVideo", "type": "String", "displayName": "Fixed Asset Photo Video", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetSoftware", "type": "String", "displayName": "Fixed Asset Software", "required": false}, {"value": "Asset.Fixed Asset.FixedAssetOtherToolsEquipment", "type": "String", "displayName": "Fixed Asset Other Tools Equipment", "required": false}, {"value": "Asset.Fixed Asset.FurnitureAndFixtures", "type": "String", "displayName": "Furniture And Fixtures", "required": false}, {"value": "Asset.Fixed Asset.Land", "type": "String", "displayName": "Land", "required": false}, {"value": "Asset.Fixed Asset.LeaseholdImprovements", "type": "String", "displayName": "Leasehold Improvements", "required": false}, {"value": "Asset.Fixed Asset.OtherFixedAssets", "type": "String", "displayName": "Other Fixed Assets", "required": false}, {"value": "Asset.Fixed Asset.AccumulatedAmortization", "type": "String", "displayName": "Accumulated Amortization", "required": false}, {"value": "Asset.Fixed Asset.Buildings", "type": "String", "displayName": "Buildings", "required": false}, {"value": "Asset.Fixed Asset.IntangibleAssets", "type": "String", "displayName": "Intangible Assets", "required": false}, {"value": "Asset.Fixed Asset.MachineryAndEquipment", "type": "String", "displayName": "Machinery And Equipment", "required": false}, {"value": "Asset.Fixed Asset.Vehicles", "type": "String", "displayName": "Vehicles", "required": false}, {"value": "Asset.Fixed Asset.AssetsInCourseOfConstruction", "type": "String", "displayName": "Assets In Course Of Construction", "required": false}, {"value": "Asset.Fixed Asset.CapitalWip", "type": "String", "displayName": "Capital Wip", "required": false}, {"value": "Asset.Fixed Asset.CumulativeDepreciationOnIntangibleAssets", "type": "String", "displayName": "Cumulative Depreciation On Intangible Assets", "required": false}, {"value": "Asset.Fixed Asset.IntangibleAssetsUnderDevelopment", "type": "String", "displayName": "Intangible Assets Under Development", "required": false}, {"value": "Asset.Fixed Asset.LandAsset", "type": "String", "displayName": "Land Asset", "required": false}, {"value": "Asset.Fixed Asset.NonCurrentAssets", "type": "String", "displayName": "Non Current Assets", "required": false}, {"value": "Asset.Fixed Asset.ParticipatingInterests", "type": "String", "displayName": "Participating Interests", "required": false}, {"value": "Asset.Fixed Asset.ProvisionsFixedAssets", "type": "String", "displayName": "Provisions Fixed Assets", "required": false}, {"value": "Asset.Other Asset.LeaseBuyout", "type": "String", "displayName": "Lease Buyout", "required": false}, {"value": "Asset.Other Asset.OtherLongTermAssets", "type": "String", "displayName": "Other Long Term Assets", "required": false}, {"value": "Asset.Other Asset.SecurityDeposits", "type": "String", "displayName": "Security Deposits", "required": false}, {"value": "Asset.Other Asset.AccumulatedAmortizationOfOtherAssets", "type": "String", "displayName": "Accumulated Amortization Of Other Assets", "required": false}, {"value": "Asset.Other Asset.Goodwill", "type": "String", "displayName": "Goodwill", "required": false}, {"value": "Asset.Other Asset.Licenses", "type": "String", "displayName": "Licenses", "required": false}, {"value": "Asset.Other Asset.OrganizationalCosts", "type": "String", "displayName": "Organizational Costs", "required": false}, {"value": "Asset.Other Asset.AssetsHeldForSale", "type": "String", "displayName": "Assets Held For Sale", "required": false}, {"value": "Asset.Other Asset.AvailableForSaleFinancialAssets", "type": "String", "displayName": "Available For Sale Financial Assets", "required": false}, {"value": "Asset.Other Asset.DeferredTax", "type": "String", "displayName": "Deferred Tax", "required": false}, {"value": "Asset.Other Asset.Investments", "type": "String", "displayName": "Investments", "required": false}, {"value": "Asset.Other Asset.LongTermInvestments", "type": "String", "displayName": "Long Term Investments", "required": false}, {"value": "Asset.Other Asset.LongTermLoansAndAdvancesToRelatedParties", "type": "String", "displayName": "Long Term Loans And Advances To Related Parties", "required": false}, {"value": "Asset.Other Asset.OtherIntangibleAssets", "type": "String", "displayName": "Other Intangible Assets", "required": false}, {"value": "Asset.Other Asset.OtherLongTermInvestments", "type": "String", "displayName": "Other Long Term Investments", "required": false}, {"value": "Asset.Other Asset.OtherLongTermLoansAndAdvances", "type": "String", "displayName": "Other Long Term Loans And Advances", "required": false}, {"value": "Asset.Other Asset.PrepaymentsAndAccruedIncome", "type": "String", "displayName": "Prepayments And Accrued Income", "required": false}, {"value": "Asset.Other Asset.ProvisionsNonCurrentAssets", "type": "String", "displayName": "Provisions Non-Current Assets", "required": false}, {"value": "Asset.Accounts Receivable.AccountsReceivable", "type": "String", "displayName": "Accounts Receivable", "required": false}, {"value": "Expense.Expense.AdvertisingPromotional", "type": "String", "displayName": "Advertising/Promotional", "required": false}, {"value": "Expense.Expense.BadDebts", "type": "String", "displayName": "Bad Debts", "required": false}, {"value": "Expense.Expense.BankCharges", "type": "String", "displayName": "Bank Charges", "required": false}, {"value": "Expense.Expense.CharitableContributions", "type": "String", "displayName": "Charitable Contributions", "required": false}, {"value": "Expense.Expense.CommissionsAndFees", "type": "String", "displayName": "Commissions And Fees", "required": false}, {"value": "Expense.Expense.Entertainment", "type": "String", "displayName": "Entertainment", "required": false}, {"value": "Expense.Expense.EntertainmentMeals", "type": "String", "displayName": "Entertainment Meals", "required": false}, {"value": "Expense.Expense.EquipmentRental", "type": "String", "displayName": "Equipment Rental", "required": false}, {"value": "Expense.Expense.FinanceCosts", "type": "String", "displayName": "Finance Costs", "required": false}, {"value": "Expense.Expense.GlobalTaxExpense", "type": "String", "displayName": "Global Tax Expense", "required": false}, {"value": "Expense.Expense.Insurance", "type": "String", "displayName": "Insurance", "required": false}, {"value": "Expense.Expense.InterestPaid", "type": "String", "displayName": "Interest Paid", "required": false}, {"value": "Expense.Expense.LegalProfessionalFees", "type": "String", "displayName": "Legal And Professional Fees", "required": false}, {"value": "Expense.Expense.OfficeExpenses", "type": "String", "displayName": "Office Expenses", "required": false}, {"value": "Expense.Expense.OfficeGeneralAdministrativeExpenses", "type": "String", "displayName": "Office/General Administrative Expenses", "required": false}, {"value": "Expense.Expense.OtherBusinessExpenses", "type": "String", "displayName": "Other Business Expenses", "required": false}, {"value": "Expense.Expense.OtherMiscellaneousServiceCost", "type": "String", "displayName": "Other Miscellaneous Service Cost", "required": false}, {"value": "Expense.Expense.PromotionalMeals", "type": "String", "displayName": "Promotional Meals", "required": false}, {"value": "Expense.Expense.RentOrLeaseOfBuildings", "type": "String", "displayName": "Rent Or Lease Of Buildings", "required": false}, {"value": "Expense.Expense.RepairMaintenance", "type": "String", "displayName": "Repair And Maintenance", "required": false}, {"value": "Expense.Expense.ShippingFreightDelivery", "type": "String", "displayName": "Shipping, Freight And Delivery", "required": false}, {"value": "Expense.Expense.SuppliesMaterials", "type": "String", "displayName": "Supplies And Materials", "required": false}, {"value": "Expense.Expense.Travel", "type": "String", "displayName": "Travel", "required": false}, {"value": "Expense.Expense.TravelMeals", "type": "String", "displayName": "Travel Meals", "required": false}, {"value": "Expense.Expense.Utilities", "type": "String", "displayName": "Utilities", "required": false}, {"value": "Expense.Expense.Auto", "type": "String", "displayName": "Auto", "required": false}, {"value": "Expense.Expense.CostOfLabor", "type": "String", "displayName": "Cost Of Labor", "required": false}, {"value": "Expense.Expense.DuesSubscriptions", "type": "String", "displayName": "Dues And Subscriptions", "required": false}, {"value": "Expense.Expense.PayrollExpenses", "type": "String", "displayName": "Payroll Expenses", "required": false}, {"value": "Expense.Expense.TaxesPaid", "type": "String", "displayName": "Taxes Paid", "required": false}, {"value": "Expense.Expense.UnappliedCashBillPaymentExpense", "type": "String", "displayName": "Unapplied Cash Bill Payment Expense", "required": false}, {"value": "Expense.Expense.Utilities", "type": "String", "displayName": "Utilities", "required": false}, {"value": "Expense.Expense.AmortizationExpense", "type": "String", "displayName": "Amortization Expense", "required": false}, {"value": "Expense.Expense.AppropriationsToDepreciation", "type": "String", "displayName": "Appropriations To Depreciation", "required": false}, {"value": "Expense.Expense.BorrowingCost", "type": "String", "displayName": "Borrowing Cost", "required": false}, {"value": "Expense.Expense.CommissionsAndFees", "type": "String", "displayName": "Commissions And Fees", "required": false}, {"value": "Expense.Expense.DistributionCosts", "type": "String", "displayName": "Distribution Costs", "required": false}, {"value": "Expense.Expense.ExternalServices", "type": "String", "displayName": "External Services", "required": false}, {"value": "Expense.Expense.ExtraordinaryCharges", "type": "String", "displayName": "Extraordinary Charges", "required": false}, {"value": "Expense.Expense.IncomeTaxExpense", "type": "String", "displayName": "Income Tax Expense", "required": false}, {"value": "Expense.Expense.LossOnDiscontinuedOperationsNetOfTax", "type": "String", "displayName": "Loss On Discontinued Operations Net Of Tax", "required": false}, {"value": "Expense.Expense.ManagementCompensation", "type": "String", "displayName": "Management Compensation", "required": false}, {"value": "Expense.Expense.OtherCurrentOperatingCharges", "type": "String", "displayName": "Other Current Operating Charges", "required": false}, {"value": "Expense.Expense.OtherExternalServices", "type": "String", "displayName": "Other External Services", "required": false}, {"value": "Expense.Expense.OtherRentalCosts", "type": "String", "displayName": "Other Rental Costs", "required": false}, {"value": "Expense.Expense.OtherSellingExpenses", "type": "String", "displayName": "Other Selling Expenses", "required": false}, {"value": "Expense.Expense.ProjectStudiesSurveysAssessments", "type": "String", "displayName": "Project Studies Surveys Assessments", "required": false}, {"value": "Expense.Expense.PurchasesRebates", "type": "String", "displayName": "Purchases Rebates", "required": false}, {"value": "Expense.Expense.ShippingAndDeliveryExpense", "type": "String", "displayName": "Shipping And Delivery Expense", "required": false}, {"value": "Expense.Expense.StaffCosts", "type": "String", "displayName": "Staff Costs", "required": false}, {"value": "Expense.Expense.Sundry", "type": "String", "displayName": "Sundry", "required": false}, {"value": "Expense.Expense.TravelExpensesGeneralAndAdminExpenses", "type": "String", "displayName": "Travel Expenses General And Admin Expenses", "required": false}, {"value": "Expense.Expense.TravelExpensesSellingExpense", "type": "String", "displayName": "Travel Expenses Selling Expense", "required": false}, {"value": "Expense.Other Expense.Depreciation", "type": "String", "displayName": "Depreciation", "required": false}, {"value": "Expense.Other Expense.ExchangeGainOrLoss", "type": "String", "displayName": "Exchange Gain Or Loss", "required": false}, {"value": "Expense.Other Expense.OtherMiscellaneousExpense", "type": "String", "displayName": "Other Miscellaneous Expense", "required": false}, {"value": "Expense.Other Expense.PenaltiesSettlements", "type": "String", "displayName": "Penalties And Settlements", "required": false}, {"value": "Expense.Other Expense.Amortization", "type": "String", "displayName": "Amortization", "required": false}, {"value": "Expense.Other Expense.GasAndFuel", "type": "String", "displayName": "Gas And Fuel", "required": false}, {"value": "Expense.Other Expense.HomeOffice", "type": "String", "displayName": "Home Office", "required": false}, {"value": "Expense.Other Expense.HomeOwnerRentalInsurance", "type": "String", "displayName": "Home Owner Rental Insurance", "required": false}, {"value": "Expense.Other Expense.OtherHomeOfficeExpenses", "type": "String", "displayName": "Other Home Office Expenses", "required": false}, {"value": "Expense.Other Expense.MortgageInterest", "type": "String", "displayName": "Mortgage Interest", "required": false}, {"value": "Expense.Other Expense.RentAndLease", "type": "String", "displayName": "Rent And Lease", "required": false}, {"value": "Expense.Other Expense.RepairsAndMaintenance", "type": "String", "displayName": "Repairs And Maintenance", "required": false}, {"value": "Expense.Other Expense.ParkingAndTolls", "type": "String", "displayName": "Parking And Tolls", "required": false}, {"value": "Expense.Other Expense.Vehicle", "type": "String", "displayName": "Vehicle", "required": false}, {"value": "Expense.Other Expense.VehicleInsurance", "type": "String", "displayName": "Vehicle Insurance", "required": false}, {"value": "Expense.Other Expense.VehicleLease", "type": "String", "displayName": "Vehicle Lease", "required": false}, {"value": "Expense.Other Expense.VehicleLoanInterest", "type": "String", "displayName": "Vehicle Loan Interest", "required": false}, {"value": "Expense.Other Expense.VehicleLoan", "type": "String", "displayName": "Vehicle Loan", "required": false}, {"value": "Expense.Other Expense.VehicleRegistration", "type": "String", "displayName": "Vehicle Registration", "required": false}, {"value": "Expense.Other Expense.VehicleRepairs", "type": "String", "displayName": "Vehicle Repairs", "required": false}, {"value": "Expense.Other Expense.OtherVehicleExpenses", "type": "String", "displayName": "Other Vehicle Expenses", "required": false}, {"value": "Expense.Other Expense.Utilities", "type": "String", "displayName": "Utilities", "required": false}, {"value": "Expense.Other Expense.WashAndRoadServices", "type": "String", "displayName": "Wash And Road Services", "required": false}, {"value": "Expense.Other Expense.DeferredTaxExpense", "type": "String", "displayName": "Deferred Tax Expense", "required": false}, {"value": "Expense.Other Expense.Depletion", "type": "String", "displayName": "Depletion", "required": false}, {"value": "Expense.Other Expense.ExceptionalItems", "type": "String", "displayName": "Exceptional Items", "required": false}, {"value": "Expense.Other Expense.ExtraordinaryItems", "type": "String", "displayName": "Extraordinary Items", "required": false}, {"value": "Expense.Other Expense.IncomeTaxOtherExpense", "type": "String", "displayName": "Income Tax Other Expense", "required": false}, {"value": "Expense.Other Expense.MatCredit", "type": "String", "displayName": "Mat Credit", "required": false}, {"value": "Expense.Other Expense.PriorPeriodItems", "type": "String", "displayName": "Prior Period Items", "required": false}, {"value": "Expense.Other Expense.TaxRoundoffGainOrLoss", "type": "String", "displayName": "Tax Roundoff Gain Or Loss", "required": false}, {"value": "Expense.Cost of Goods Sold.EquipmentRentalCos", "type": "String", "displayName": "Equipment Rental - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.OtherCostsOfServiceCos", "type": "String", "displayName": "Other Costs Of Sales - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.ShippingFreightDeliveryCos", "type": "String", "displayName": "Shipping, Freight And Delivery - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.SuppliesMaterialsCogs", "type": "String", "displayName": "Supplies And Materials - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.CostOfLaborCos", "type": "String", "displayName": "Cost Of Labor - COS", "required": false}, {"value": "Expense.Cost of Goods Sold.CostOfSales", "type": "String", "displayName": "Cost Of Sales", "required": false}, {"value": "Expense.Cost of Goods Sold.FreightAndDeliveryCost", "type": "String", "displayName": "Freight And Delivery Cost", "required": false}, {"value": "Income.Income.NonProfitIncome", "type": "String", "displayName": "Non Profit Income", "required": false}, {"value": "Income.Income.OtherPrimaryIncome", "type": "String", "displayName": "Other Primary Income", "required": false}, {"value": "Income.Income.SalesOfProductIncome", "type": "String", "displayName": "Sales Of ProductIncome", "required": false}, {"value": "Income.Income.ServiceFeeIncome", "type": "String", "displayName": "Service Fee Income", "required": false}, {"value": "Income.Income.DiscountsRefundsGiven", "type": "String", "displayName": "Discounts Refunds Given", "required": false}, {"value": "Income.Income.UnappliedCashPaymentIncome", "type": "String", "displayName": "Unapplied Cash Payment Income", "required": false}, {"value": "Income.Income.CashReceiptIncome", "type": "String", "displayName": "Cash Receipt Income", "required": false}, {"value": "Income.Income.OperatingGrants", "type": "String", "displayName": "Operating Grants", "required": false}, {"value": "Income.Income.OtherCurrentOperatingIncome", "type": "String", "displayName": "Other Current Operating Income", "required": false}, {"value": "Income.Income.OwnWorkCapitalized", "type": "String", "displayName": "Own Work Capitalized", "required": false}, {"value": "Income.Income.RevenueGeneral", "type": "String", "displayName": "Revenue General", "required": false}, {"value": "Income.Income.SalesRetail", "type": "String", "displayName": "Sales Retail", "required": false}, {"value": "Income.Income.SalesWholesale", "type": "String", "displayName": "Sales Wholesale", "required": false}, {"value": "Income.Income.SavingsByTaxScheme", "type": "String", "displayName": "Savings By Tax Scheme", "required": false}, {"value": "Income.Other Income.DividendIncome", "type": "String", "displayName": "Dividend Income", "required": false}, {"value": "Income.Other Income.InterestEarned", "type": "String", "displayName": "Interest Earned", "required": false}, {"value": "Income.Other Income.OtherInvestmentIncome", "type": "String", "displayName": "Other Investment Income", "required": false}, {"value": "Income.Other Income.OtherMiscellaneousIncome", "type": "String", "displayName": "Other Miscellaneous Income", "required": false}, {"value": "Income.Other Income.TaxExemptInterest", "type": "String", "displayName": "Tax Exempt Interest", "required": false}, {"value": "Income.Other Income.GainLossOnSaleOfFixedAssets", "type": "String", "displayName": "Gain Loss On Sale Of Fixed Assets", "required": false}, {"value": "Income.Other Income.GainLossOnSaleOfInvestments", "type": "String", "displayName": "Gain Loss On Sale Of Investments", "required": false}, {"value": "Income.Other Income.LossOnDisposalOfAssets", "type": "String", "displayName": "Loss On Disposal Of Assets", "required": false}, {"value": "Income.Other Income.OtherOperatingIncome", "type": "String", "displayName": "Other Operating Income", "required": false}, {"value": "Income.Other Income.UnrealisedLossOnSecuritiesNetOfTax", "type": "String", "displayName": "Unrealised Loss On Securities Net Of Tax", "required": false}, {"value": "Liability.Accounts Payable.AccountsPayable", "type": "String", "displayName": "Accounts Payable", "required": false}, {"value": "Liability.Accounts Payable.OutstandingDuesMicroSmallEnterprise", "type": "String", "displayName": "Outstanding Dues Micro Small Enterprise", "required": false}, {"value": "Liability.Accounts Payable.OutstandingDuesOtherThanMicroSmallEnterprise", "type": "String", "displayName": "Outstanding Dues Other Than Micro Small Enterprise", "required": false}, {"value": "Liability.Credit Card.CreditCard", "type": "String", "displayName": "Credit Card", "required": false}, {"value": "Liability.Long Term Liability.NotesPayable", "type": "String", "displayName": "Notes Payable", "required": false}, {"value": "Liability.Long Term Liability.OtherLongTermLiabilities", "type": "String", "displayName": "Other Long Term Liabilities", "required": false}, {"value": "Liability.Long Term Liability.ShareholderNotesPayable", "type": "String", "displayName": "Shareholder Notes Payable", "required": false}, {"value": "Liability.Long Term Liability.AccrualsAndDeferredIncome", "type": "String", "displayName": "Accruals And Deferred Income", "required": false}, {"value": "Liability.Long Term Liability.AccruedLongLermLiabilities", "type": "String", "displayName": "Accrued Long Lerm Liabilities", "required": false}, {"value": "Liability.Long Term Liability.AccruedVacationPayable", "type": "String", "displayName": "Accrued Vacation Payable", "required": false}, {"value": "Liability.Long Term Liability.BankLoans", "type": "String", "displayName": "Bank Loans", "required": false}, {"value": "Liability.Long Term Liability.DebtsRelatedToParticipatingInterests", "type": "String", "displayName": "Debts Related To Participating Interests", "required": false}, {"value": "Liability.Long Term Liability.DeferredTaxLiabilities", "type": "String", "displayName": "Deferred Tax Liabilities", "required": false}, {"value": "Liability.Long Term Liability.GovernmentAndOtherPublicAuthorities", "type": "String", "displayName": "Government And Other Public Authorities", "required": false}, {"value": "Liability.Long Term Liability.GroupAndAssociates", "type": "String", "displayName": "Group And Associates", "required": false}, {"value": "Liability.Long Term Liability.LiabilitiesRelatedToAssetsHeldForSale", "type": "String", "displayName": "Liabilities Related To Assets Held For Sale", "required": false}, {"value": "Liability.Long Term Liability.LongTermBorrowings", "type": "String", "displayName": "Long Term Borrowings", "required": false}, {"value": "Liability.Long Term Liability.LongTermDebit", "type": "String", "displayName": "Long Term Debit", "required": false}, {"value": "Liability.Long Term Liability.LongTermEmployeeBenefitObligations", "type": "String", "displayName": "Long Term Employee Benefit Obligations", "required": false}, {"value": "Liability.Long Term Liability.ObligationsUnderFinanceLeases", "type": "String", "displayName": "Obligations Under Finance Leases", "required": false}, {"value": "Liability.Long Term Liability.OtherLongTermProvisions", "type": "String", "displayName": "Other Long Term Provisions", "required": false}, {"value": "Liability.Long Term Liability.ProvisionForLiabilities", "type": "String", "displayName": "Provision For Liabilities", "required": false}, {"value": "Liability.Long Term Liability.ProvisionsNonCurrentLiabilities", "type": "String", "displayName": "Provisions Non Current Liabilities", "required": false}, {"value": "Liability.Long Term Liability.StaffAndRelatedLongTermLiabilityAccounts", "type": "String", "displayName": "Staff And Related Long Term Liability Accounts", "required": false}, {"value": "Liability.Other Current Liability.DirectDepositPayable", "type": "String", "displayName": "Direct Deposit Payable", "required": false}, {"value": "Liability.Other Current Liability.LineOfCredit", "type": "String", "displayName": "Line Of Credit", "required": false}, {"value": "Liability.Other Current Liability.LoanPayable", "type": "String", "displayName": "Loan Payable", "required": false}, {"value": "Liability.Other Current Liability.GlobalTaxPayable", "type": "String", "displayName": "Global Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.GlobalTaxSuspense", "type": "String", "displayName": "Global Tax Suspense", "required": false}, {"value": "Liability.Other Current Liability.OtherCurrentLiabilities", "type": "String", "displayName": "Other Current Liabilities", "required": false}, {"value": "Liability.Other Current Liability.PayrollClearing", "type": "String", "displayName": "Payroll Clearing", "required": false}, {"value": "Liability.Other Current Liability.PayrollTaxPayable", "type": "String", "displayName": "Payroll Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.PrepaidExpensesPayable", "type": "String", "displayName": "Prepaid Expenses Payable", "required": false}, {"value": "Liability.Other Current Liability.RentsInTrustLiability", "type": "String", "displayName": "Rents In Trust Liability", "required": false}, {"value": "Liability.Other Current Liability.TrustAccountsLiabilities", "type": "String", "displayName": "Trust Accounts Liabilities", "required": false}, {"value": "Liability.Other Current Liability.FederalIncomeTaxPayable", "type": "String", "displayName": "Federal Income Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.InsurancePayable", "type": "String", "displayName": "Insurance Payable", "required": false}, {"value": "Liability.Other Current Liability.SalesTaxPayable", "type": "String", "displayName": "Sales Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.StateLocalIncomeTaxPayable", "type": "String", "displayName": "State Local Income Tax Payable", "required": false}, {"value": "Liability.Other Current Liability.AccruedLiabilities", "type": "String", "displayName": "Accrued Liabilities", "required": false}, {"value": "Liability.Other Current Liability.CurrentLiabilities", "type": "String", "displayName": "Current Liabilities", "required": false}, {"value": "Liability.Other Current Liability.CurrentPortionEmployeeBenefitsObligations", "type": "String", "displayName": "Current Portion EmployeeBenefits Obligations", "required": false}, {"value": "Liability.Other Current Liability.CurrentPortionOfObligationsUnderFinanceLeases", "type": "String", "displayName": "Current Portion Of Obligations Under Finance Leases", "required": false}, {"value": "Liability.Other Current Liability.CurrentTaxLiability", "type": "String", "displayName": "Current Tax Liability", "required": false}, {"value": "Liability.Other Current Liability.DividendsPayable", "type": "String", "displayName": "Dividends Payable", "required": false}, {"value": "Liability.Other Current Liability.DutiesAndTaxes", "type": "String", "displayName": "Duties And Taxes", "required": false}, {"value": "Liability.Other Current Liability.InterestPayables", "type": "String", "displayName": "Interest Payables", "required": false}, {"value": "Liability.Other Current Liability.ProvisionForWarrantyObligations", "type": "String", "displayName": "Provision For Warranty Obligations", "required": false}, {"value": "Liability.Other Current Liability.ProvisionsCurrentLiabilities", "type": "String", "displayName": "Provisions Current Liabilities", "required": false}, {"value": "Liability.Other Current Liability.ShortTermBorrowings", "type": "String", "displayName": "Short Term Borrowings", "required": false}, {"value": "Liability.Other Current Liability.SocialSecurityAgencies", "type": "String", "displayName": "Social Security Agencies", "required": false}, {"value": "Liability.Other Current Liability.StaffAndRelatedLiabilityAccounts", "type": "String", "displayName": "Staff And Related Liability Accounts", "required": false}, {"value": "Liability.Other Current Liability.SundryDebtorsAndCreditors", "type": "String", "displayName": "Sundry Debtors And Creditors", "required": false}, {"value": "Liability.Other Current Liability.TradeAndOtherPayables", "type": "String", "displayName": "Trade And Other Payables", "required": false}, {"value": "Equity.Equity.OpeningBalanceEquity", "type": "String", "displayName": "Opening Balance Equity", "required": false}, {"value": "Equity.Equity.PartnersEquity", "type": "String", "displayName": "Partners Equity", "required": false}, {"value": "Equity.Equity.RetainedEarnings", "type": "String", "displayName": "Retained Earnings", "required": false}, {"value": "Equity.Equity.AccumulatedAdjustment", "type": "String", "displayName": "Accumulated Adjustment", "required": false}, {"value": "Equity.Equity.OwnersEquity", "type": "String", "displayName": "Owners Equity", "required": false}, {"value": "Equity.Equity.PaidInCapitalOrSurplus", "type": "String", "displayName": "Paid In Capital Or Surplus", "required": false}, {"value": "Equity.Equity.PartnerContributions", "type": "String", "displayName": "Partner Contributions", "required": false}, {"value": "Equity.Equity.PartnerDistributions", "type": "String", "displayName": "Partner Distributions", "required": false}, {"value": "Equity.Equity.PreferredStock", "type": "String", "displayName": "Preferred Stock", "required": false}, {"value": "Equity.Equity.CommonStock", "type": "String", "displayName": "Common Stock", "required": false}, {"value": "Equity.Equity.TreasuryStock", "type": "String", "displayName": "Treasury Stock", "required": false}, {"value": "Equity.Equity.EstimatedTaxes", "type": "String", "displayName": "Estimated Taxes", "required": false}, {"value": "Equity.Equity.Healthcare", "type": "String", "displayName": "Healthcare", "required": false}, {"value": "Equity.Equity.PersonalIncome", "type": "String", "displayName": "Personal Income", "required": false}, {"value": "Equity.Equity.PersonalExpense", "type": "String", "displayName": "Personal Expense", "required": false}, {"value": "Equity.Equity.AccumulatedOtherComprehensiveIncome", "type": "String", "displayName": "Accumulated Other Comprehensive Income", "required": false}, {"value": "Equity.Equity.CalledUpShareCapital", "type": "String", "displayName": "Called Up Share Capital", "required": false}, {"value": "Equity.Equity.CapitalReserves", "type": "String", "displayName": "Capital Reserves", "required": false}, {"value": "Equity.Equity.DividendDisbursed", "type": "String", "displayName": "Dividend Disbursed", "required": false}, {"value": "Equity.Equity.EquityInEarningsOfSubsiduaries", "type": "String", "displayName": "Equity In Earnings Of Subsiduaries", "required": false}, {"value": "Equity.Equity.InvestmentGrants", "type": "String", "displayName": "Investment Grants", "required": false}, {"value": "Equity.Equity.MoneyReceivedAgainstShareWarrants", "type": "String", "displayName": "Money Received Against Share Warrants", "required": false}, {"value": "Equity.Equity.OtherFreeReserves", "type": "String", "displayName": "Other Free Reserves", "required": false}, {"value": "Equity.Equity.ShareApplicationMoneyPendingAllotment", "type": "String", "displayName": "Share Application Money Pending Allotment", "required": false}, {"value": "Equity.Equity.ShareCapital", "type": "String", "displayName": "Share Capital", "required": false}, {"value": "Equity.Equity.Funds", "type": "String", "displayName": "Funds", "required": false}]}}} - Sage Business Cloud Accounting: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true, "validation": {"warnings": [], "information": [{"field": "Name", "details": "Should not be longer than 200 characters."}]}}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Should be a number between 1 and 99999999."}]}}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "options": [{"value": "SALES", "type": "String", "displayName": "Sales", "required": false}, {"value": "OTHER_INCOME", "type": "String", "displayName": "Other Income", "required": false}, {"value": "DIRECT_EXPENSES", "type": "String", "displayName": "Direct Expenses", "required": false}, {"value": "OVERHEADS", "type": "String", "displayName": "Overheads", "required": false}, {"value": "DEPRECIATION", "type": "String", "displayName": "Depreciation", "required": false}, {"value": "CURRENT_ASSETS", "type": "String", "displayName": "Current Assets", "required": false}, {"value": "FIXED_ASSETS", "type": "String", "displayName": "Fixed Assets", "required": false}, {"value": "FUTURE_ASSETS", "type": "String", "displayName": "Future Assets", "required": false}, {"value": "BANK", "type": "String", "displayName": "Bank", "required": false}, {"value": "CURRENT_LIABILITY", "type": "String", "displayName": "Current Liability", "required": false}, {"value": "FUTURE_LIABILITY", "type": "String", "displayName": "Future Liability", "required": false}, {"value": "EQUITY", "type": "String", "displayName": "Equity", "required": false}, {"value": "LINE_OF_CREDIT", "type": "String", "displayName": "Credit Card / Loan", "required": false}]}}} - Sage Intacct: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [{"field": "NominalCode", "details": "Must be unique within the entity."}, {"field": "NominalCode", "details": "Must be at most 24 characters in length, although restrictions may vary between entities."}], "information": []}}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true}, "status": {"type": "String", "displayName": "Account Status", "description": "The status of the account", "required": true, "options": [{"value": "Active", "type": "String", "displayName": "Active", "required": false}, {"value": "Archived", "type": "String", "displayName": "Archived", "required": false}]}, "type": {"type": "String", "displayName": "Account Type", "description": "The type, or base category, of the account", "required": true, "options": [{"value": "Asset", "type": "String", "displayName": "Asset", "required": false}, {"value": "Equity", "type": "String", "displayName": "Equity", "required": false}, {"value": "Expense", "type": "String", "displayName": "Expense", "required": false}, {"value": "Income", "type": "String", "displayName": "Income", "required": false}, {"value": "Liability", "type": "String", "displayName": "Liability", "required": false}]}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true, "validation": {"warnings": [], "information": [{"field": "FullyQualifiedCategory", "details": "Any category that is part of the hierarchy of one of: 'Assets', 'Equity', 'Liabilities', 'Total Expenses' and 'Total Income' is permitted."}]}}}} - Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true}, "name": {"type": "String", "displayName": "Name", "description": "Name of the account", "required": true}, "description": {"type": "String", "displayName": "Description", "description": "Description of the account", "required": true}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "The full category of the account e.g. Liability.Current or Income.Revenue", "required": true}, "fullyQualifiedName": {"type": "String", "displayName": "Fully Qualified Name", "description": "The full name of the account e.g. Liability.Current.VAT or Income.Revenue.Sales", "required": true}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the account", "required": true}, "currentBalance": {"type": "Number", "displayName": "Current Balance", "description": "The current balance in the account", "required": true}, "type": {"type": "String", "displayName": "Account Type", "description": "The type, or base category, of the account", "required": true}, "status": {"type": "String", "displayName": "Account Status", "description": "The status of the account", "required": true}, "isBankAccount": {"type": "Boolean", "displayName": "Is Bank Account?", "description": "Confirms whether the nominal account represents a bank account or not", "required": true}, "validDatatypeLinks": {"type": "Array", "displayName": "Valid Datatype Links", "description": "Describes which fields on other data types are valid links to this account in the originating system", "required": true, "properties": {"property": {"type": "String", "displayName": "Property", "description": "The field on the source data type that other data types can link to", "required": true}, "links": {"type": "Array", "displayName": "Links", "description": "A collection of absolute names of fields from other data types, e.g. Invoice.LineItems.AccountRef.Id", "required": true}}}, "metadata": {"type": "Object", "displayName": "Metadata", "description": "Miscellaneous data about the item", "required": true, "properties": {"isDeleted": {"type": "Boolean", "displayName": "IsDeleted", "description": "A boolean to indicate whether the object has been deleted", "required": true}}}}} - Xero: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Nominal Account", "description": "Nominal Accounts are the categories a business uses to record transactions", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "Identifier for the nominal account.", "required": true, "validation": {"warnings": [{"field": "NominalCode", "details": "Max length of 10 characters."}], "information": []}}, "name": {"type": "String", "displayName": "Name", "description": "Name of account as it appears in the chart of accounts or general ledger.", "required": true, "validation": {"warnings": [], "information": [{"field": "Name", "details": "Payments are enabled to this account if the name ends in .PaymentsEnabled."}]}}, "description": {"type": "String", "displayName": "Description", "description": "Description for the nominal account.", "required": false}, "fullyQualifiedCategory": {"type": "String", "displayName": "Fully Qualified Category", "description": "Account type and category for nominal account.", "required": true, "options": [{"value": "Asset.Current", "type": "String", "displayName": "Current Asset", "required": false}, {"value": "Asset.Fixed", "type": "String", "displayName": "Fixed Asset", "required": false}, {"value": "Asset.Inventory", "type": "String", "displayName": "Inventory", "required": false}, {"value": "Asset.NonCurrent", "type": "String", "displayName": "Non-current Asset", "required": false}, {"value": "Asset.Prepayment", "type": "String", "displayName": "Prepayment", "required": false}, {"value": "Expense.DirectCosts", "type": "String", "displayName": "Direct Costs", "required": false}, {"value": "Expense.Expense", "type": "String", "displayName": "Expense", "required": false}, {"value": "Expense.Overhead", "type": "String", "displayName": "Overhead", "required": false}, {"value": "Expense.Superannuation", "type": "String", "displayName": "Superannuation", "required": false}, {"value": "Expense.Wages", "type": "String", "displayName": "Wages", "required": false}, {"value": "Income.Sales", "type": "String", "displayName": "Sales", "required": false}, {"value": "Income.Revenue", "type": "String", "displayName": "Revenue", "required": false}, {"value": "Income.Other", "type": "String", "displayName": "Other Income", "required": false}, {"value": "Liability.Current", "type": "String", "displayName": "Current Liability", "required": false}, {"value": "Liability.Depreciation", "type": "String", "displayName": "Depreciation", "required": false}, {"value": "Liability.Liability", "type": "String", "displayName": "Liability", "required": false}, {"value": "Liability.NonCurrent", "type": "String", "displayName": "Non Current Liability", "required": false}, {"value": "Liability.PayAsYouGo", "type": "String", "displayName": "Pay As You Go Liability", "required": false}, {"value": "Liability.Superannuation", "type": "String", "displayName": "Superannuation Liability", "required": false}, {"value": "Liability.WagesPayable", "type": "String", "displayName": "Wages Payable Liability", "required": false}, {"value": "Equity.Equity", "type": "String", "displayName": "Equity", "required": false}]}}} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-bank-account: - QuickBooks Online: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountName": "GBP Bank Account", "accountType": "Debit", "accountNumber": "12345678", "currency": "GBP", "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Active"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "bbf55378-5e09-4654-9ce4-ff3208e30267", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 16290} - "400": - application/json: {} - "500": - application/json: {} - Xero: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"accountName": "Xero GBP Bank Account", "accountType": "Debit", "sortCode": "445566", "accountNumber": "12345678", "currency": "GBP", "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Active"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "bbf55378-5e09-4654-9ce4-ff3208e30267", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 16290} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Active"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-bank-account: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "currency": "GBP", "status": "Active"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "bbf55378-5e09-4654-9ce4-ff3208e30267", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 16290} - "400": - application/json: {} - "500": - application/json: {} - get-create-bankAccounts-model: - Dynamics 365 Business Central: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true, "validation": {"warnings": [], "information": [{"field": "AccountName", "details": "Needs to be of the format '{No.}-{Name}'"}]}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": false}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Bank Account Posting Group with Nominal Account must exist"}]}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "SortCode", "details": "Must have a length between 0 and 20 characters"}]}}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": false}, "overdraftLimit": {"type": "Number", "displayName": "Overdraft Limit", "description": "The pre-arranged overdraft limit of the account", "required": false, "validation": {"warnings": [], "information": [{"field": "OverdraftLimit", "details": "Default value is 0"}]}}}} - Exact (Netherlands): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": true, "validation": {"warnings": [{"field": "AccountNumber", "details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP."}], "information": []}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [{"field": "SortCode", "details": "Must be 6 characters long if the specified currency is GBP."}, {"field": "SortCode", "details": "Must be provided if the specified currency is GBP."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": false}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false}}} - Exact (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": true, "validation": {"warnings": [{"field": "AccountNumber", "details": "Should not exceed the maximum length of 14 characters if the specified currency is GBP."}], "information": []}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [{"field": "SortCode", "details": "Must be 6 characters long if the specified currency is GBP."}, {"field": "SortCode", "details": "Must be provided if the specified currency is GBP."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": false}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false}}} - FreeAgent: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [{"field": "SortCode", "details": "Must have a length between 0 and 8 characters"}], "information": []}}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": false}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": false}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true, "options": [{"value": "AED", "type": "String", "displayName": "AED", "required": false}, {"value": "AMD", "type": "String", "displayName": "AMD", "required": false}, {"value": "AOA", "type": "String", "displayName": "AOA", "required": false}, {"value": "ARS", "type": "String", "displayName": "ARS", "required": false}, {"value": "AUD", "type": "String", "displayName": "AUD", "required": false}, {"value": "AWG", "type": "String", "displayName": "AWG", "required": false}, {"value": "AZN", "type": "String", "displayName": "AZN", "required": false}, {"value": "BBD", "type": "String", "displayName": "BBD", "required": false}, {"value": "BDT", "type": "String", "displayName": "BDT", "required": false}, {"value": "BGN", "type": "String", "displayName": "BGN", "required": false}, {"value": "BRL", "type": "String", "displayName": "BRL", "required": false}, {"value": "BWP", "type": "String", "displayName": "BWP", "required": false}, {"value": "CAD", "type": "String", "displayName": "CAD", "required": false}, {"value": "CHF", "type": "String", "displayName": "CHF", "required": false}, {"value": "CLP", "type": "String", "displayName": "CLP", "required": false}, {"value": "CNY", "type": "String", "displayName": "CNY", "required": false}, {"value": "COP", "type": "String", "displayName": "COP", "required": false}, {"value": "CRC", "type": "String", "displayName": "CRC", "required": false}, {"value": "CUC", "type": "String", "displayName": "CUC", "required": false}, {"value": "CUP", "type": "String", "displayName": "CUP", "required": false}, {"value": "CZK", "type": "String", "displayName": "CZK", "required": false}, {"value": "DKK", "type": "String", "displayName": "DKK", "required": false}, {"value": "DOP", "type": "String", "displayName": "DOP", "required": false}, {"value": "EGP", "type": "String", "displayName": "EGP", "required": false}, {"value": "EUR", "type": "String", "displayName": "EUR", "required": false}, {"value": "FJD", "type": "String", "displayName": "FJD", "required": false}, {"value": "GBP", "type": "String", "displayName": "GBP", "required": false}, {"value": "GEL", "type": "String", "displayName": "GEL", "required": false}, {"value": "GHS", "type": "String", "displayName": "GHS", "required": false}, {"value": "GTQ", "type": "String", "displayName": "GTQ", "required": false}, {"value": "GYD", "type": "String", "displayName": "GYD", "required": false}, {"value": "HKD", "type": "String", "displayName": "HKD", "required": false}, {"value": "HNL", "type": "String", "displayName": "HNL", "required": false}, {"value": "HRK", "type": "String", "displayName": "HRK", "required": false}, {"value": "HUF", "type": "String", "displayName": "HUF", "required": false}, {"value": "IDR", "type": "String", "displayName": "IDR", "required": false}, {"value": "ILS", "type": "String", "displayName": "ILS", "required": false}, {"value": "INR", "type": "String", "displayName": "INR", "required": false}, {"value": "ISK", "type": "String", "displayName": "ISK", "required": false}, {"value": "JMD", "type": "String", "displayName": "JMD", "required": false}, {"value": "JPY", "type": "String", "displayName": "JPY", "required": false}, {"value": "KES", "type": "String", "displayName": "KES", "required": false}, {"value": "KRW", "type": "String", "displayName": "KRW", "required": false}, {"value": "KWD", "type": "String", "displayName": "KWD", "required": false}, {"value": "KYD", "type": "String", "displayName": "KYD", "required": false}, {"value": "KZT", "type": "String", "displayName": "KZT", "required": false}, {"value": "LAK", "type": "String", "displayName": "LAK", "required": false}, {"value": "LBP", "type": "String", "displayName": "LBP", "required": false}, {"value": "LKR", "type": "String", "displayName": "LKR", "required": false}, {"value": "LTL", "type": "String", "displayName": "LTL", "required": false}, {"value": "LVL", "type": "String", "displayName": "LVL", "required": false}, {"value": "MAD", "type": "String", "displayName": "MAD", "required": false}, {"value": "MDL", "type": "String", "displayName": "MDL", "required": false}, {"value": "MGA", "type": "String", "displayName": "MGA", "required": false}, {"value": "MUR", "type": "String", "displayName": "MUR", "required": false}, {"value": "MVR", "type": "String", "displayName": "MVR", "required": false}, {"value": "MWK", "type": "String", "displayName": "MWK", "required": false}, {"value": "MXN", "type": "String", "displayName": "MXN", "required": false}, {"value": "MYR", "type": "String", "displayName": "MYR", "required": false}, {"value": "MZN", "type": "String", "displayName": "MZN", "required": false}, {"value": "NAD", "type": "String", "displayName": "NAD", "required": false}, {"value": "NGN", "type": "String", "displayName": "NGN", "required": false}, {"value": "NOK", "type": "String", "displayName": "NOK", "required": false}, {"value": "NPR", "type": "String", "displayName": "NPR", "required": false}, {"value": "NZD", "type": "String", "displayName": "NZD", "required": false}, {"value": "OMR", "type": "String", "displayName": "OMR", "required": false}, {"value": "PEN", "type": "String", "displayName": "PEN", "required": false}, {"value": "PHP", "type": "String", "displayName": "PHP", "required": false}, {"value": "PKR", "type": "String", "displayName": "PKR", "required": false}, {"value": "PLN", "type": "String", "displayName": "PLN", "required": false}, {"value": "QAR", "type": "String", "displayName": "QAR", "required": false}, {"value": "RON", "type": "String", "displayName": "RON", "required": false}, {"value": "RSD", "type": "String", "displayName": "RSD", "required": false}, {"value": "RUB", "type": "String", "displayName": "RUB", "required": false}, {"value": "RWF", "type": "String", "displayName": "RWF", "required": false}, {"value": "SAR", "type": "String", "displayName": "SAR", "required": false}, {"value": "SCR", "type": "String", "displayName": "SCR", "required": false}, {"value": "SEK", "type": "String", "displayName": "SEK", "required": false}, {"value": "SGD", "type": "String", "displayName": "SGD", "required": false}, {"value": "THB", "type": "String", "displayName": "THB", "required": false}, {"value": "TND", "type": "String", "displayName": "TND", "required": false}, {"value": "TRY", "type": "String", "displayName": "TRY", "required": false}, {"value": "TTD", "type": "String", "displayName": "TTD", "required": false}, {"value": "TWD", "type": "String", "displayName": "TWD", "required": false}, {"value": "TZS", "type": "String", "displayName": "TZS", "required": false}, {"value": "UAH", "type": "String", "displayName": "UAH", "required": false}, {"value": "UGX", "type": "String", "displayName": "UGX", "required": false}, {"value": "USD", "type": "String", "displayName": "USD", "required": false}, {"value": "UYU", "type": "String", "displayName": "UYU", "required": false}, {"value": "VEF", "type": "String", "displayName": "VEF", "required": false}, {"value": "VND", "type": "String", "displayName": "VND", "required": false}, {"value": "VUV", "type": "String", "displayName": "VUV", "required": false}, {"value": "XAF", "type": "String", "displayName": "XAF", "required": false}, {"value": "XCD", "type": "String", "displayName": "XCD", "required": false}, {"value": "XOF", "type": "String", "displayName": "XOF", "required": false}, {"value": "ZAR", "type": "String", "displayName": "ZAR", "required": false}, {"value": "ZMK", "type": "String", "displayName": "ZMK", "required": false}]}, "balance": {"type": "Number", "displayName": "Balance", "description": "The balance of the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "Balance", "details": "The opening balance, in the account currency"}]}}, "institution": {"type": "String", "displayName": "Institution", "description": "The institution of the bank account", "required": false}}} - KashFlow: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Account Name", "description": "Name of the bank account as it appears in Kashflow.", "required": true}, "balance": {"type": "Number", "displayName": "Balance", "description": "The opening balance, in the account currency.", "required": false}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account.", "required": true}}} - QuickBooks Desktop: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true, "validation": {"warnings": [{"field": "NominalCode", "details": "Max length of 7 characters."}], "information": []}}, "accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true, "validation": {"warnings": [{"field": "AccountName", "details": "Max length of 31 characters."}], "information": []}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": false, "validation": {"warnings": [{"field": "Currency", "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."}], "information": [{"field": "Currency", "details": "If not set, will default to the base currency of the QuickBooks Desktop company"}]}}, "balance": {"type": "Number", "displayName": "Balance", "description": "The balance of the bank account", "required": false}}} - QuickBooks Online Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Account Name", "description": "Name of account as it appears in the chart of accounts or general ledger.", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "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.", "required": true}, "currency": {"type": "String", "displayName": "Currency", "description": "Currency of the bank account.", "required": true}}} - Sage Business Cloud Accounting: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true, "validation": {"warnings": [], "information": [{"field": "AccountName", "details": "Must be provided."}, {"field": "AccountName", "details": "Should not be longer than 50 characters."}]}}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true, "validation": {"warnings": [], "information": [{"field": "Currency", "details": "Must be provided."}, {"field": "Currency", "details": "Must match the company's base currency."}]}}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "SortCode", "details": "Should be a 6 digit number."}]}}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": false, "validation": {"warnings": [], "information": [{"field": "AccountNumber", "details": "Should not be longer than 25 characters."}]}}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": false, "validation": {"warnings": [], "information": [{"field": "IBan", "details": "Should be in the international bank account number format."}]}}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": false, "validation": {"warnings": [], "information": [{"field": "NominalCode", "details": "Should be a number between 1 and 99999999."}]}}}} - Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "200": - application/json: {"type": "Object", "displayName": "Bank Account", "description": "An account that bank transactions may be recorded against", "required": true, "properties": {"accountName": {"type": "String", "displayName": "Name", "description": "The name of the bank account in the originating system", "required": true}, "accountType": {"type": "String", "displayName": "Account Type", "description": "The type of account", "required": true}, "nominalCode": {"type": "String", "displayName": "Nominal Code", "description": "The external reference given to each nominal account for a business", "required": true}, "sortCode": {"type": "String", "displayName": "Sort Code", "description": "The sort code for the bank account", "required": true}, "accountNumber": {"type": "String", "displayName": "Account Number", "description": "The account number for the bank account", "required": true}, "iBan": {"type": "String", "displayName": "IBAN", "description": "The international bank account number of the account. Often used when making or receiving international payments", "required": true}, "currency": {"type": "String", "displayName": "Currency", "description": "The currency of the bank account", "required": true}, "balance": {"type": "Number", "displayName": "Balance", "description": "The balance of the bank account", "required": true}, "availableBalance": {"type": "Number", "displayName": "Available Balance", "description": "The available balance of the bank account", "required": true}, "overdraftLimit": {"type": "Number", "displayName": "Overdraft Limit", "description": "The pre-arranged overdraft limit of the account", "required": true}, "institution": {"type": "String", "displayName": "Institution", "description": "The institution of the bank account", "required": true}, "metadata": {"type": "Object", "displayName": "Metadata", "description": "Miscellaneous data about the item", "required": true, "properties": {"isDeleted": {"type": "Boolean", "displayName": "IsDeleted", "description": "A boolean to indicate whether the object has been deleted", "required": true}}}}} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - list-customers: - speakeasy-default-list-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: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - 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: {"results": [{"modifiedDate": "2023-04-26T12:38:16Z", "sourceModifiedDate": "2022-07-03T01:27:00", "id": "c8180244-74ac-40cf-a5df-6d83661c44d7", "customerName": "Arjun Kuvalis", "contactName": "Werner Langworth", "emailAddress": "Arjun34@hotmail.com", "defaultCurrency": "GBP", "phone": "014605 64820", "addresses": [{"type": "Delivery", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "city": "Fernandohaven", "region": "Northern Ireland", "country": "United Kingdom", "postalCode": "JG04 7PV"}, {"type": "Delivery", "line1": "Suite 096", "line2": "864 Halie Course", "city": "Juliochester", "region": "England", "country": "United Kingdom", "postalCode": "DZ8 4BF"}, {"type": "Delivery", "line1": "Suite 001", "line2": "416 Stokes Fords", "city": "Naderborough", "region": "Wales", "country": "United Kingdom", "postalCode": "XG25 0XX"}], "contacts": [{"name": "Werner Langworth", "email": "Werner_Langworth@hotmail.com", "phone": [], "address": {"type": "Delivery", "line1": "Apt. 145", "line2": "317 Williamson Freeway", "city": "Hortenseville", "region": "Scotland", "country": "United Kingdom", "postalCode": "CV4 2HR"}, "status": "Active"}, {"name": "Belle Glover", "email": "Belle51@yahoo.com", "phone": [], "address": {"type": "Delivery", "line1": "Suite 075", "line2": "9921 Dickens Walk", "city": "South Ali", "region": "Scotland", "country": "United Kingdom", "postalCode": "TI04 4OO"}, "status": "Active"}], "registrationNumber": "NI7JEJVM", "taxNumber": "7505220209.583549", "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T12:38:16Z", "sourceModifiedDate": "2022-12-03T11:05:01", "id": "6d162ee4-47b4-46c6-a2e6-aa9edd0fe6b0", "customerName": "Breitenberg, Emard and Schiller", "contactName": "Miguel Hahn", "emailAddress": "contact@BreitenbergEmardandSchiller.biz", "defaultCurrency": "GBP", "phone": "0800 445 6957", "addresses": [{"type": "Billing", "line1": "Apt. 184", "line2": "60578 Louie Springs", "city": "East Khalid", "region": "Wales", "country": "United Kingdom", "postalCode": "XW89 7NT"}], "contacts": [{"name": "Miguel Hahn", "email": "Miguel.Hahn@gmail.com", "phone": [{"number": "018555 09614", "type": "Landline"}], "address": {"type": "Delivery", "line1": "Suite 400", "line2": "21930 Milan Lane", "city": "Reingerton", "region": "Wales", "country": "United Kingdom", "postalCode": "QG10 2DL"}, "status": "Active"}], "registrationNumber": "KME0AMIL", "taxNumber": "8560920952.553111", "status": "Archived", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 20, "_links": {"self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-27T14:21:25Z", "sourceModifiedDate": "2023-01-17T14:50:54Z", "id": "0e2f7751-7696-ed11-bff5-6045bd0d2ad6", "customerName": "", "contactName": "", "emailAddress": "", "defaultCurrency": "GBP", "phone": "", "addresses": [{"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "", "postalCode": ""}], "contacts": [{"name": "", "email": "", "phone": [], "address": {"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "", "postalCode": ""}, "status": "Active"}], "taxNumber": "", "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-27T14:21:25Z", "sourceModifiedDate": "2021-06-03T08:48:36Z", "id": "0ef95175-48c4-eb11-9f0a-0022481b4343", "customerName": "", "contactName": "", "emailAddress": "", "defaultCurrency": "GBP", "phone": "", "addresses": [{"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "GB", "postalCode": ""}], "contacts": [{"name": "", "email": "", "phone": [], "address": {"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "GB", "postalCode": ""}, "status": "Active"}], "taxNumber": "", "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 42, "_links": {"self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-14T15:26:37Z", "id": "555f8251-c65a-433a-a813-5dbe04321d1e", "customerName": "Ab Netherlands", "defaultCurrency": "EUR", "addresses": [{"type": "Billing", "country": "NL"}], "contacts": [], "status": "Active"}, {"modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2022-05-24T11:53:21Z", "id": "9fd1f78e-67aa-4af7-8a10-df1fc5fb5841", "customerName": "anna test 2", "defaultCurrency": "EUR", "addresses": [{"type": "Billing", "country": "NL"}], "contacts": [], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 71, "_links": {"self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-26T13:33:08Z", "sourceModifiedDate": "2020-02-26T11:23:50Z", "id": "5f20075a-a28e-434d-81a6-2db0dc170e87", "customerName": "Abdi 99", "emailAddress": "email@codat.io", "defaultCurrency": "GBP", "addresses": [{"type": "Billing", "line1": "Ink Rooms", "city": "London", "country": "GB", "postalCode": "WC1X 0BE"}], "contacts": [], "registrationNumber": "123456789", "taxNumber": "GB339 0727 47", "status": "Active"}, {"modifiedDate": "2022-10-26T13:33:08Z", "sourceModifiedDate": "2020-02-24T12:00:50Z", "id": "1d9dc1a7-92d6-441b-93fd-42c9fb321b1c", "customerName": "Abdulbasit Al-haj", "contactName": "abeee", "emailAddress": "a.alhaj@codat.io", "defaultCurrency": "GBP", "addresses": [{"type": "Billing", "country": "GB"}], "contacts": [{"name": "abeee", "phone": [], "address": {"type": "Unknown", "line1": "", "country": "GB "}, "status": "Active", "modifiedDate": "2020-02-24T12:00:51.027Z"}], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 53, "_links": {"self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-17T06:02:46Z", "id": "11526230", "customerName": "-", "contactName": "Test 1", "addresses": [{"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}], "contacts": [{"name": "Test 1", "phone": [], "address": {"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}, "status": "Unknown"}], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-24T06:19:23Z", "id": "9677150", "customerName": "-", "contactName": "Test 1", "addresses": [{"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}], "contacts": [{"name": "Test 1", "phone": [], "address": {"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}, "status": "Unknown"}], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 159, "_links": {"self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-24T16:07:23Z", "sourceModifiedDate": "2022-05-18T09:23:56", "id": "634509", "customerName": "A test customer 14 (updated)", "contactName": "test person name", "emailAddress": "test14@example.com", "defaultCurrency": "GBP", "phone": "01876 541245", "addresses": [{"type": "Billing", "line1": "Line 1", "line2": "Line 2", "city": "Some city", "region": "A region", "country": "Country 1", "postalCode": "SW1 2JQ"}], "contacts": [{"name": "test person1", "email": "test14A@example.com", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"name": "test person2", "email": "test14B@example.com", "phone": [{"number": "1234 56789", "type": "Primary"}, {"number": "9876 54321", "type": "Unknown"}], "status": "Active"}, {"name": "test person name", "email": "test14@example.com", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-24T16:07:23Z", "sourceModifiedDate": "2022-05-11T11:39:58", "id": "634486", "customerName": "A test customer name 2", "contactName": "test person name", "emailAddress": "test8@example.com", "defaultCurrency": "GBP", "phone": "01876 541245", "addresses": [{"type": "Billing", "line1": "Line 1", "line2": "Line 2", "city": "Some city", "region": "A region", "country": "Country 1", "postalCode": "SW1 2JQ"}], "contacts": [{"name": "test person1", "email": "test9@example.com", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"name": "test person2", "email": "test10@example.com", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "987654321", "type": "Unknown"}], "status": "Active"}, {"name": "test person name", "email": "test8@example.com", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 39, "_links": {"self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-09-30T10:29:15Z", "sourceModifiedDate": "0001-01-01T00:00:00", "id": "92227673", "customerName": "Chekko Customer Test 01", "contactName": "", "emailAddress": "", "phone": "", "addresses": [], "contacts": [{"name": "", "email": "", "phone": [], "status": "Active"}], "taxNumber": "", "status": "Active"}, {"modifiedDate": "2022-09-30T10:29:15Z", "sourceModifiedDate": "2021-05-04T13:22:19", "id": "88459410", "customerName": "Diogo Sousa", "contactName": "Mr Diogo Sousa", "emailAddress": "diogomail@mail.com", "phone": "123123123", "addresses": [{"type": "Billing", "line1": "Billing Address", "line2": "Billing line 2 Billing line 3", "city": "Billing line 4", "country": "United Kingdom", "postalCode": "123321"}, {"type": "Delivery", "line1": "Delivery Address", "line2": "Delivery line2 Delivery line3", "city": "Delivery line4", "country": "United Kingdom", "postalCode": "123321"}], "contacts": [{"name": "Mr Diogo Sousa", "email": "diogomail@mail.com", "phone": [{"number": "123123123", "type": "Landline"}, {"number": "321321321", "type": "Mobile"}], "address": {"type": "Billing", "line1": "Billing Address", "line2": "Billing line 2 Billing line 3", "city": "Billing line 4", "country": "United Kingdom", "postalCode": "123321"}, "status": "Active"}, {"name": "Mr Diogo Sousa", "phone": [], "address": {"type": "Delivery", "line1": "Delivery Address", "line2": "Delivery line2 Delivery line3", "city": "Delivery line4", "country": "United Kingdom", "postalCode": "123321"}, "status": "Active"}], "taxNumber": "", "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 10, "_links": {"self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-01-11T12:28:49", "id": "773", "customerName": "119 Test Customer", "contactName": "Mr Test Customer", "defaultCurrency": "GBP", "addresses": [], "contacts": [], "status": "Active"}, {"modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-07-27T14:29:16", "id": "172722", "customerName": "1248 European Company", "contactName": "European Company", "defaultCurrency": "GBP", "addresses": [], "contacts": [], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 4, "_links": {"self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-26T09:07:55Z", "sourceModifiedDate": "2023-12-16T05:06:42", "id": "150000-933272658", "customerName": "Abercrombie, Kristy", "contactName": "Kristy Abercrombie", "emailAddress": "kristy@samplename.com", "defaultCurrency": "GBP", "phone": "415-555-6579", "addresses": [{"type": "Delivery", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "city": "Bayshore", "region": "CA", "postalCode": "94326"}, {"type": "Billing", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "city": "Bayshore", "region": "CA", "postalCode": "94326"}], "contacts": [{"name": "Abercrombie, Kristy", "email": "kristy@samplename.com", "phone": [{"number": "415-555-6579", "type": "Primary"}], "status": "Active"}, {"name": "Kristy Abercrombie", "phone": [], "status": "Active"}, {"name": "Steve Darcangelo", "phone": [], "status": "Active"}], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T09:07:55Z", "sourceModifiedDate": "2023-12-16T05:06:42", "id": "800000D0-1182061376", "customerName": "Allard, Robert", "contactName": "Amanda Roberts", "emailAddress": "rallard@myemail.com", "defaultCurrency": "GBP", "phone": "650-555-3422", "addresses": [{"type": "Delivery", "line1": "Robert Allard", "line2": "92834 Chandler St.", "city": "Millbrae", "region": "CA", "postalCode": "94030"}, {"type": "Billing", "line1": "Robert Allard", "line2": "92834 Chandler St.", "city": "Millbrae", "region": "CA", "postalCode": "94030"}], "contacts": [{"name": "Allard, Robert", "email": "rallard@myemail.com", "phone": [{"number": "650-555-3422", "type": "Primary"}, {"number": "650-555-9804", "type": "Fax"}, {"number": "650-555-8349", "type": "Unknown"}], "status": "Active"}, {"name": "Robert Allard", "phone": [], "status": "Active"}, {"name": "Rachel Fisher", "phone": [], "status": "Active"}], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 64, "_links": {"self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-01-18T11:02:35Z", "sourceModifiedDate": "2022-12-08T15:42:59Z", "id": "9", "customerName": "Abe", "contactName": "Abraham's Company", "emailAddress": "ab@email.com", "defaultCurrency": "GBP", "addresses": [], "contacts": [{"name": "Abe", "email": "ab@email.com", "phone": [{"number": "01111111111", "type": "Mobile"}], "status": "Active"}], "registrationNumber": "XXXX9900001", "taxNumber": "XXXX9900001", "status": "Active"}, {"modifiedDate": "2023-01-18T11:02:35Z", "sourceModifiedDate": "2022-08-22T09:21:09Z", "id": "49", "customerName": "adeel qbo child test", "contactName": "Adeel test", "emailAddress": "adeel@adeel.com", "defaultCurrency": "GBP", "phone": "123456789", "addresses": [{"type": "Billing", "line1": "4 Privet Drive", "city": "London", "country": "United Kingdom", "postalCode": "WD25 7LR"}, {"type": "Delivery", "line1": "4 Privet Drive", "city": "London", "country": "United Kingdom", "postalCode": "WD25 7LR"}], "contacts": [{"name": "Adeel test", "email": "adeel@adeel.com", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "07546543216", "type": "Mobile"}], "address": {"type": "Billing", "line1": "4 Privet Drive", "city": "London", "country": "United Kingdom", "postalCode": "WD25 7LR"}, "status": "Active"}], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 40, "_links": {"self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2016-09-12T18:53:19Z", "id": "66", "customerName": "Abercrombie International Group", "contactName": "Kristy Abercrombie", "defaultCurrency": "GBP", "addresses": [{"type": "Billing", "line1": "123 Main St", "city": "New York, NY"}], "contacts": [{"name": "Abercrombie International Group (deleted)", "phone": [], "address": {"type": "Billing", "line1": "123 Main St", "city": "New York, NY"}, "status": "Archived"}], "status": "Archived", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2023-03-29T01:12:55Z", "id": "67", "customerName": "Abercrombie International Group", "contactName": "Natalie Watts", "emailAddress": "n.watts@google.com", "defaultCurrency": "USD", "addresses": [{"type": "Billing"}, {"type": "Delivery"}], "contacts": [{"name": "Abercrombie International Group", "email": "n.watts@google.com", "phone": [], "address": {"type": "Billing"}, "status": "Active"}], "registrationNumber": "XXXXVat123456", "taxNumber": "XXXXVat123456", "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 243, "_links": {"self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-14T09:35:53Z", "sourceModifiedDate": "2022-04-27T15:17:36Z", "id": "A1D001", "customerName": "A1 Design Services", "contactName": "Lee Dalkin", "emailAddress": "newbusinessadvice@sage.com", "defaultCurrency": "GBP", "phone": "01742 876 234", "addresses": [{"type": "Delivery", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "", "postalCode": "BP12 7HT"}, {"type": "Delivery", "line1": "23a Union Street", "line2": "", "city": "Manchester", "region": "", "country": "", "postalCode": "M2 6JK"}, {"type": "Billing", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "Great Britain", "postalCode": "BP12 7HT"}], "contacts": [{"name": "Lee Dalkin", "email": "newbusinessadvice@sage.com", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"name": "Malcolm Leverret", "email": "", "phone": [], "status": "Active"}, {"name": "Jim Thomas", "email": "Jim@a1designservices.co.uk", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"name": "Jullian Plawsworth", "email": "Jullian@a1designservices.co.uk", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "registrationNumber": "", "taxNumber": "GB238 3839 38", "status": "Active"}, {"modifiedDate": "2022-10-14T09:35:53Z", "sourceModifiedDate": "2020-09-23T10:28:58Z", "id": "A1D002", "customerName": "A2 Design Services", "contactName": "Lee Dalkin", "emailAddress": "newbusinessadvice@sage.com", "defaultCurrency": "GBP", "phone": "01742 876 234", "addresses": [{"type": "Billing", "line1": "77a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "Great Britain", "postalCode": "BP12 7HT"}], "contacts": [{"name": "Lee Dalkin", "email": "newbusinessadvice@sage.com", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"name": "Malcolm Leverret", "email": "", "phone": [], "status": "Active"}, {"name": "Jim Thomas", "email": "Jim@a1designservices.co.uk", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"name": "Jullian Plawsworth", "email": "Jullian@a1designservices.co.uk", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "registrationNumber": "", "taxNumber": "GB238 3839 40", "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 43, "_links": {"self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-30T14:42:41Z", "sourceModifiedDate": "2022-11-25T09:43:54Z", "id": "A1D001", "customerName": "A1 Design Services", "contactName": "Ian Cairns", "emailAddress": "newbusinessadvice@sage.com", "defaultCurrency": "GBP", "phone": "01742 876 234", "addresses": [{"type": "Delivery", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "GB", "postalCode": "BP12 7HT"}, {"type": "Delivery", "line1": "23a Union Street", "line2": "", "city": "Manchester", "region": "", "country": "GB", "postalCode": "M2 6JK"}, {"type": "Unknown", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "GB", "postalCode": "BP12 7HT"}], "contacts": [], "taxNumber": "GB238 3839 38", "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-30T14:42:41Z", "sourceModifiedDate": "2022-11-25T09:43:54Z", "id": "ABS001", "customerName": "ABS Garages Ltd", "contactName": "Mike Hall", "emailAddress": "newbusinessadvice@sage.com", "defaultCurrency": "GBP", "phone": "0191 254 5909", "addresses": [{"type": "Delivery", "line1": "Swanson Industries", "line2": "Dukes Industrial Estate", "city": "Whitley Bay", "region": "North Tyneside", "country": "GB", "postalCode": "NE56 4ER"}, {"type": "Delivery", "line1": "Unit 34", "line2": "Holystone Ind Estate", "city": "Hebburn", "region": "Tyne & Wear", "country": "GB", "postalCode": "NE31 1VB"}, {"type": "Unknown", "line1": "Unit 34", "line2": "Holystone Ind Estate", "city": "Hebburn", "region": "Tyne & Wear", "country": "GB", "postalCode": "NE31 1VB"}], "contacts": [], "taxNumber": "GB745 4584 68", "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 30, "_links": {"self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2021-05-10T16:31:51Z", "id": "260f6a3f94a243738f2d5e08496a41a8", "customerName": "100 test name", "contactName": "Main Contact", "emailAddress": "email@codat.io", "defaultCurrency": "GBP", "phone": "contact phone number", "addresses": [{"type": "Billing", "line1": "Aruba Address line 1", "line2": "Aruba Address line 2", "city": "Aruba City", "region": "Aruba Province", "country": "Aruba (AW)", "postalCode": "Aruba Post"}], "contacts": [{"phone": [{"number": "contact mobile number", "type": "Mobile"}, {"number": "contact fax number", "type": "Fax"}], "status": "Unknown"}], "status": "Active"}, {"modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2021-06-10T14:22:46Z", "id": "44a5d9461d9e4f6d90a5ace251c5cf35", "customerName": "100 test name DS", "contactName": "Main Contact", "emailAddress": "DCemail@codat.io", "defaultCurrency": "GBP", "phone": "contact phone number", "addresses": [{"type": "Billing", "line1": "POST - Aruba Address line 1", "line2": "POST - Aruba Address line 2", "city": "POST - Aruba City", "region": "Aruba Province", "country": "Aruba (AW)", "postalCode": "Aruba Post"}], "contacts": [], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 168, "_links": {"self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-04T16:32:21Z", "sourceModifiedDate": "2022-09-06T12:58:27", "id": "188", "customerName": "33Across", "contactName": "Yuna Conn", "defaultCurrency": "USD", "phone": "520-393-4468", "addresses": [{"type": "Unknown", "line1": "155 Westend Point", "line2": "", "city": "Albuquerque", "region": "NM", "country": "United States", "postalCode": "87140"}], "contacts": [{"name": "Conn, Yuna", "phone": [{"number": "520-393-4468", "type": "Primary"}], "address": {"type": "Unknown", "line1": "155 Westend Point", "line2": "", "city": "Albuquerque", "region": "NM", "country": "United States", "postalCode": "87140"}, "status": "Unknown"}], "taxNumber": "", "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-04T16:32:21Z", "sourceModifiedDate": "2020-10-20T05:01:49", "id": "324", "customerName": "3Way International Logistics", "contactName": "Lauri O'Heagertie", "defaultCurrency": "CAD", "phone": "410-309-3976", "addresses": [{"type": "Unknown", "line1": "7 Lerdahl Junction", "line2": "", "city": "Sparwood", "region": "British Columbia", "country": "Canada", "postalCode": "L4R"}], "contacts": [{"name": "O'Heagertie, Lauri", "phone": [{"number": "410-309-3976", "type": "Primary"}], "address": {"type": "Unknown", "line1": "7 Lerdahl Junction", "line2": "", "city": "Sparwood", "region": "British Columbia", "country": "Canada", "postalCode": "L4R"}, "status": "Unknown"}], "taxNumber": "", "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 530, "_links": {"self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2019-10-17T07:59:04Z", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4", "customerName": "ABC Textiles", "contactName": "", "emailAddress": "c.taylor@codat.io", "defaultCurrency": "USD", "addresses": [], "contacts": [], "status": "Active"}, {"modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2020-03-17T19:12:39Z", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjM3MTUzNDI2", "customerName": "Coffee Cart", "contactName": "Coffee Carl", "emailAddress": "coffee.cart@example.com", "defaultCurrency": "GBP", "phone": "0201111", "addresses": [{"type": "Billing", "line1": "11 Coffee Lane", "line2": "Coffee Town", "city": "Coffee City", "region": "Hampshire", "country": "United Kingdom", "postalCode": "CC1 1CC"}], "contacts": [{"name": "Coffee Carl", "phone": [{"number": "07733", "type": "Mobile"}], "status": "Active"}], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 10, "_links": {"self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "customerName": "24 Locks", "emailAddress": "", "addresses": [], "contacts": [], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "customerName": "7-Eleven", "emailAddress": "", "addresses": [], "contacts": [], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 48, "_links": {"self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/customers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-06-09T14:36:47", "id": "104957000000032105", "customerName": "A B", "contactName": "Contact (First Name) Contact (Last Name)", "emailAddress": "contactperson@whateveryouwantidontcare12345.com", "defaultCurrency": "GBP", "phone": "Work Phone", "addresses": [], "contacts": [{"name": "Contact (First Name) Contact (Last Name)", "email": "contactperson@whateveryouwantidontcare12345.com", "phone": [{"number": "Work Phone", "type": "Landline"}, {"number": "Mobile", "type": "Mobile"}], "status": "Active"}], "status": "Active"}, {"modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-28T15:09:22", "id": "104957000000054050", "customerName": "Doe, John", "contactName": "John Doe", "emailAddress": "", "defaultCurrency": "GBP", "addresses": [], "contacts": [{"name": "John Doe", "email": "", "phone": [], "status": "Active"}], "status": "Active"}], "pageNumber": 1, "pageSize": 2, "totalResults": 14, "_links": {"self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/customers"}, "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"}}} - 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: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - 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: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-customer: - Clear Books: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-26T12:38:16Z", "sourceModifiedDate": "2022-07-03T01:27:00", "id": "c8180244-74ac-40cf-a5df-6d83661c44d7", "customerName": "Arjun Kuvalis", "contactName": "Werner Langworth", "emailAddress": "Arjun34@hotmail.com", "defaultCurrency": "GBP", "phone": "014605 64820", "addresses": [{"type": "Delivery", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "city": "Fernandohaven", "region": "Northern Ireland", "country": "United Kingdom", "postalCode": "JG04 7PV"}, {"type": "Delivery", "line1": "Suite 096", "line2": "864 Halie Course", "city": "Juliochester", "region": "England", "country": "United Kingdom", "postalCode": "DZ8 4BF"}, {"type": "Delivery", "line1": "Suite 001", "line2": "416 Stokes Fords", "city": "Naderborough", "region": "Wales", "country": "United Kingdom", "postalCode": "XG25 0XX"}], "contacts": [{"name": "Werner Langworth", "email": "Werner_Langworth@hotmail.com", "phone": [], "address": {"type": "Delivery", "line1": "Apt. 145", "line2": "317 Williamson Freeway", "city": "Hortenseville", "region": "Scotland", "country": "United Kingdom", "postalCode": "CV4 2HR"}, "status": "Active"}, {"name": "Belle Glover", "email": "Belle51@yahoo.com", "phone": [], "address": {"type": "Delivery", "line1": "Suite 075", "line2": "9921 Dickens Walk", "city": "South Ali", "region": "Scotland", "country": "United Kingdom", "postalCode": "TI04 4OO"}, "status": "Active"}], "registrationNumber": "NI7JEJVM", "taxNumber": "7505220209.583549", "status": "Active", "metadata": {"isDeleted": false}} - Dynamics 365 Business Central: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-27T14:21:25Z", "sourceModifiedDate": "2023-01-17T14:50:54Z", "id": "0e2f7751-7696-ed11-bff5-6045bd0d2ad6", "customerName": "", "contactName": "", "emailAddress": "", "defaultCurrency": "GBP", "phone": "", "addresses": [{"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "", "postalCode": ""}], "contacts": [{"name": "", "email": "", "phone": [], "address": {"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "", "postalCode": ""}, "status": "Active"}], "taxNumber": "", "status": "Active", "metadata": {"isDeleted": false}} - Exact (Netherlands): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-14T15:26:37Z", "id": "555f8251-c65a-433a-a813-5dbe04321d1e", "customerName": "Ab Netherlands", "defaultCurrency": "EUR", "addresses": [{"type": "Billing", "country": "NL"}], "contacts": [], "status": "Active"} - Exact (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-26T13:33:08Z", "sourceModifiedDate": "2020-02-26T11:23:50Z", "id": "5f20075a-a28e-434d-81a6-2db0dc170e87", "customerName": "Abdi 99", "emailAddress": "email@codat.io", "defaultCurrency": "GBP", "addresses": [{"type": "Billing", "line1": "Ink Rooms", "city": "London", "country": "GB", "postalCode": "WC1X 0BE"}], "contacts": [], "registrationNumber": "123456789", "taxNumber": "GB339 0727 47", "status": "Active"} - FreeAgent: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-25T14:19:12Z", "sourceModifiedDate": "2023-04-17T06:02:46Z", "id": "11526230", "customerName": "-", "contactName": "Test 1", "addresses": [{"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}], "contacts": [{"name": "Test 1", "phone": [], "address": {"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}, "status": "Unknown"}], "status": "Active", "metadata": {"isDeleted": false}} - FreshBooks: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-24T16:07:23Z", "sourceModifiedDate": "2022-05-18T09:23:56", "id": "634509", "customerName": "A test customer 14 (updated)", "contactName": "test person name", "emailAddress": "test14@example.com", "defaultCurrency": "GBP", "phone": "01876 541245", "addresses": [{"type": "Billing", "line1": "Line 1", "line2": "Line 2", "city": "Some city", "region": "A region", "country": "Country 1", "postalCode": "SW1 2JQ"}], "contacts": [{"name": "test person1", "email": "test14A@example.com", "phone": [{"number": "24681012", "type": "Primary"}, {"number": "121086420", "type": "Unknown"}], "status": "Active"}, {"name": "test person2", "email": "test14B@example.com", "phone": [{"number": "123456789", "type": "Primary"}, {"number": "987654321", "type": "Unknown"}], "status": "Active"}, {"name": "test person name", "email": "test14@example.com", "phone": [{"number": "01876 541245", "type": "Unknown"}], "status": "Active"}], "status": "Active", "metadata": {"isDeleted": false}} - KashFlow: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-09-30T10:29:15Z", "sourceModifiedDate": "0001-01-01T00:00:00", "id": "92227673", "customerName": "Chekko Customer Test 01", "contactName": "", "emailAddress": "", "phone": "", "addresses": [], "contacts": [{"name": "", "email": "", "phone": [], "status": "Active"}], "taxNumber": "", "status": "Active"} - Oracle NetSuite: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-01-30T14:48:02Z", "sourceModifiedDate": "2022-01-11T12:28:49", "id": "773", "customerName": "119 Test Customer", "contactName": "Mr Test Customer", "defaultCurrency": "GBP", "addresses": [], "contacts": [], "status": "Active"} - QuickBooks Desktop: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-26T09:07:55Z", "sourceModifiedDate": "2023-12-16T05:06:42", "id": "150000-933272658", "customerName": "Abercrombie, Kristy", "contactName": "Kristy Abercrombie", "emailAddress": "kristy@samplename.com", "defaultCurrency": "GBP", "phone": "415-555-6579", "addresses": [{"type": "Delivery", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "city": "Bayshore", "region": "CA", "postalCode": "94326"}, {"type": "Billing", "line1": "Kristy Abercrombie", "line2": "5647 Cypress Hill Rd", "city": "Bayshore", "region": "CA", "postalCode": "94326"}], "contacts": [{"name": "Abercrombie, Kristy", "email": "kristy@samplename.com", "phone": [{"number": "415-555-6579", "type": "Primary"}], "status": "Active"}, {"name": "Kristy Abercrombie", "phone": [], "status": "Active"}, {"name": "Steve Darcangelo", "phone": [], "status": "Active"}], "status": "Active", "metadata": {"isDeleted": false}} - QuickBooks Online: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-01-18T11:02:35Z", "sourceModifiedDate": "2022-12-08T15:42:59Z", "id": "9", "customerName": "Abe", "contactName": "Abraham's Company", "emailAddress": "ab@email.com", "defaultCurrency": "GBP", "addresses": [], "contacts": [{"name": "Abe", "email": "ab@email.com", "phone": [{"number": "01111111111", "type": "Mobile"}], "status": "Active"}], "registrationNumber": "XXXX9900001", "taxNumber": "XXXX9900001", "status": "Active"} - QuickBooks Online Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-26T09:35:56Z", "sourceModifiedDate": "2016-09-12T18:53:19Z", "id": "66", "customerName": "Abercrombie International Group", "contactName": "Kristy Abercrombie", "defaultCurrency": "GBP", "addresses": [{"type": "Billing", "line1": "123 Main St", "city": "New York, NY"}], "contacts": [{"name": "Abercrombie International Group (deleted)", "phone": [], "address": {"type": "Billing", "line1": "123 Main St", "city": "New York, NY"}, "status": "Archived"}], "status": "Archived", "metadata": {"isDeleted": false}} - Sage 200cloud: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-14T09:35:53Z", "sourceModifiedDate": "2022-04-27T15:17:36Z", "id": "A1D001", "customerName": "A1 Design Services", "contactName": "Lee Dalkin", "emailAddress": "newbusinessadvice@sage.com", "defaultCurrency": "GBP", "phone": "01742 876 234", "addresses": [{"type": "Delivery", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "", "postalCode": "BP12 7HT"}, {"type": "Delivery", "line1": "23a Union Street", "line2": "", "city": "Manchester", "region": "", "country": "", "postalCode": "M2 6JK"}, {"type": "Billing", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "Great Britain", "postalCode": "BP12 7HT"}], "contacts": [{"name": "Lee Dalkin", "email": "newbusinessadvice@sage.com", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Landline"}, {"number": "01742 876 236", "type": "Fax"}], "status": "Active"}, {"name": "Malcolm Leverret", "email": "", "phone": [], "status": "Active"}, {"name": "Jim Thomas", "email": "Jim@a1designservices.co.uk", "phone": [{"number": "01742 876 234", "type": "Landline"}, {"number": "01742 876 235", "type": "Fax"}], "status": "Active"}, {"name": "Jullian Plawsworth", "email": "Jullian@a1designservices.co.uk", "phone": [{"number": "0151 349 3939", "type": "Landline"}, {"number": "0151 349 3940", "type": "Fax"}], "status": "Active"}], "registrationNumber": "", "taxNumber": "GB238 3839 38", "status": "Active"} - Sage 50 (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-30T14:42:41Z", "sourceModifiedDate": "2022-11-25T09:43:54Z", "id": "A1D001", "customerName": "A1 Design Services", "contactName": "Ian Cairns", "emailAddress": "newbusinessadvice@sage.com", "defaultCurrency": "GBP", "phone": "01742 876 234", "addresses": [{"type": "Delivery", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "GB", "postalCode": "BP12 7HT"}, {"type": "Delivery", "line1": "23a Union Street", "line2": "", "city": "Manchester", "region": "", "country": "GB", "postalCode": "M2 6JK"}, {"type": "Unknown", "line1": "67a Station Road", "line2": "", "city": "Blackpool", "region": "Lancashire", "country": "GB", "postalCode": "BP12 7HT"}], "contacts": [], "taxNumber": "GB238 3839 38", "status": "Active", "metadata": {"isDeleted": false}} - Sage Business Cloud Accounting: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2021-05-10T16:31:51Z", "id": "260f6a3f94a243738f2d5e08496a41a8", "customerName": "100 test name", "contactName": "Main Contact", "emailAddress": "email@codat.io", "defaultCurrency": "GBP", "phone": "contact phone number", "addresses": [{"type": "Billing", "line1": "Aruba Address line 1", "line2": "Aruba Address line 2", "city": "Aruba City", "region": "Aruba Province", "country": "Aruba (AW)", "postalCode": "Aruba Post"}], "contacts": [{"phone": [{"number": "contact mobile number", "type": "Mobile"}, {"number": "contact fax number", "type": "Fax"}], "status": "Unknown"}], "status": "Active"} - Sage Intacct: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-04T16:32:21Z", "sourceModifiedDate": "2022-09-06T12:58:27", "id": "188", "customerName": "33Across", "contactName": "Yuna Conn", "defaultCurrency": "USD", "phone": "520-393-4468", "addresses": [{"type": "Unknown", "line1": "155 Westend Point", "line2": "", "city": "Albuquerque", "region": "NM", "country": "United States", "postalCode": "87140"}], "contacts": [{"name": "Conn, Yuna", "phone": [{"number": "520-393-4468", "type": "Primary"}], "address": {"type": "Unknown", "line1": "155 Westend Point", "line2": "", "city": "Albuquerque", "region": "NM", "country": "United States", "postalCode": "87140"}, "status": "Unknown"}], "taxNumber": "", "status": "Active", "metadata": {"isDeleted": false}} - Wave: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-11-16T18:15:30Z", "sourceModifiedDate": "2019-10-17T07:59:04Z", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O0N1c3RvbWVyOjMyMzkzNTA4", "customerName": "ABC Textiles", "contactName": "", "emailAddress": "c.taylor@codat.io", "defaultCurrency": "USD", "addresses": [], "contacts": [], "status": "Active"} - Xero: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-15T20:35:10Z", "sourceModifiedDate": "2023-02-17T18:03:42", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "customerName": "24 Locks", "emailAddress": "", "addresses": [], "contacts": [], "status": "Active", "metadata": {"isDeleted": false}} - Zoho Books: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-06-09T14:36:47", "id": "104957000000032105", "customerName": "A B", "contactName": "Contact (First Name) Contact (Last Name)", "emailAddress": "contactperson@whateveryouwantidontcare12345.com", "defaultCurrency": "GBP", "phone": "Work Phone", "addresses": [], "contacts": [{"name": "Contact (First Name) Contact (Last Name)", "email": "contactperson@whateveryouwantidontcare12345.com", "phone": [{"number": "Work Phone", "type": "Landline"}, {"number": "Mobile", "type": "Mobile"}], "status": "Active"}], "status": "Active"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-customer: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "defaultCurrency": "GBP", "contacts": [{"phone": null, "status": "Unknown", "modifiedDate": "2022-10-23T00:00:00Z"}], "status": "Unknown"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-customer: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "defaultCurrency": "GBP", "contacts": [{"phone": null, "status": "Unknown", "modifiedDate": "2022-10-23T00:00:00Z"}], "status": "Unknown"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "defaultCurrency": "GBP", "contacts": [{"phone": null, "status": "Unknown", "modifiedDate": "2022-10-23T00:00:00Z"}], "status": "Active"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "6df7882c-3b9a-422b-806d-10a8882c0066", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "TimedOut", "statusCode": 973924} - "400": - application/json: {} - "500": - application/json: {} - update-customer: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - forceUpdate: false - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "defaultCurrency": "GBP", "contacts": [{"phone": [{"number": "+44 25691 154789", "type": "Primary"}], "status": "Unknown", "modifiedDate": "2022-10-23T00:00:00Z"}], "status": "Active"} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-customer: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - forceUpdate: false - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "defaultCurrency": "GBP", "contacts": [{"phone": [{"number": "+44 25691 154789", "type": "Primary"}], "status": "Unknown", "modifiedDate": "2022-10-23T00:00:00Z"}], "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "defaultCurrency": "GBP", "contacts": [{"phone": [{"number": "+44 25691 154789", "type": "Primary"}], "status": "Unknown", "modifiedDate": "2022-10-23T00:00:00Z"}], "status": "Archived"}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "da9d96e3-14de-4669-8614-4a94010074c2", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 671250} - "400": - application/json: {} - "500": - application/json: {} - list-suppliers: - speakeasy-default-list-suppliers: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - query: - page: 1 - pageSize: 100 - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee" - orderBy: "-modifiedDate" - responses: - "200": - application/json: {"pageNumber": 1, "pageSize": 10, "totalResults": 1, "_links": {"self": {"href": "/companies/{id}/data/{dataType}"}, "current": {"href": "/companies/{id}/data/{dataType}?page=1&pageSize=10"}}} - "400": - application/json: {} - "500": - application/json: {} - 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: {"results": [{"modifiedDate": "2023-04-26T12:38:17Z", "sourceModifiedDate": "1660-11-28T23:18:00", "id": "owQ2Gqgj9f", "supplierName": "Abshire - Kshlerin", "contactName": "Faye Hansen", "emailAddress": "hello@Abshire-Kshlerin.info", "phone": "01338 858162", "addresses": [{"type": "Delivery", "line1": "Suite 431", "line2": "289 Giles Lake", "city": "Cesarmouth", "region": "Northern Ireland", "country": "United Kingdom", "postalCode": "BG40 9GP"}], "registrationNumber": "VYL1XZXR", "taxNumber": "1396267523.0914588", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T12:38:17Z", "sourceModifiedDate": "0177-04-27T11:56:00", "id": "FyUkHbZxhn", "supplierName": "Arjun Kuvalis", "contactName": "Werner Langworth", "emailAddress": "Arjun34@hotmail.com", "phone": "0116 796 3163", "addresses": [{"type": "Delivery", "line1": "Suite 214", "line2": "8439 Lueilwitz Passage", "city": "Fernandohaven", "region": "Northern Ireland", "country": "United Kingdom", "postalCode": "JG04 7PV"}, {"type": "Delivery", "line1": "Suite 096", "line2": "864 Halie Course", "city": "Juliochester", "region": "England", "country": "United Kingdom", "postalCode": "DZ8 4BF"}, {"type": "Delivery", "line1": "Suite 001", "line2": "416 Stokes Fords", "city": "Naderborough", "region": "Wales", "country": "United Kingdom", "postalCode": "XG25 0XX"}], "registrationNumber": "NI7JEJVM", "taxNumber": "7505220209.583549", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 100, "_links": {"self": {"href": "/companies/354a121b-855f-4d25-90ad-0905b498c1c0/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-27T14:21:12Z", "sourceModifiedDate": "2020-11-04T11:44:22Z", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "supplierName": "", "contactName": "", "emailAddress": "", "phone": "", "addresses": [{"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "GB", "postalCode": ""}], "taxNumber": "", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-27T14:21:12Z", "sourceModifiedDate": "2022-10-25T13:17:36Z", "id": "be49ec62-6754-ed11-946f-0022481b67d1", "supplierName": "", "contactName": "", "emailAddress": "", "phone": "", "addresses": [{"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "GB", "postalCode": ""}], "taxNumber": "", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 31, "_links": {"self": {"href": "/companies/d6849caf-c146-41be-8335-b73346e3bd84/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2022-07-15T12:01:15Z", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "supplierName": "Abe", "contactName": "Kelly's Contact Name", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "city": "Bakersfield", "region": "California", "country": "US", "postalCode": "933081"}], "registrationNumber": "8409314368", "status": "Active", "defaultCurrency": "EUR"}, {"modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2021-06-09T12:04:08Z", "id": "00014c12-2616-481a-a2e8-31bdf2497775", "supplierName": "Ann's test supplier 2", "contactName": "Ann's contact name", "emailAddress": "anna@anna888888.com", "phone": "55555555", "addresses": [{"type": "Billing", "line1": "line1", "line2": "line2", "city": "city", "region": "region", "country": "RU", "postalCode": "postal"}], "registrationNumber": "55566677788899944455", "taxNumber": "RU4444444", "status": "Active", "defaultCurrency": "USD"}], "pageNumber": 1, "pageSize": 2, "totalResults": 73, "_links": {"self": {"href": "/companies/b83b1923-4db6-45a8-a779-b4e320c15979/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-26T13:33:13Z", "sourceModifiedDate": "2017-08-02T10:58:54Z", "id": "0185fea2-0298-445b-909a-0db685118a9e", "supplierName": "a", "addresses": [{"type": "Billing", "country": "GB"}], "status": "Active", "defaultCurrency": "GBP"}, {"modifiedDate": "2022-10-26T13:33:13Z", "sourceModifiedDate": "2020-05-01T14:05:46Z", "id": "64ae712f-4155-48bb-9fce-98232c51d979", "supplierName": "aa", "addresses": [{"type": "Billing", "country": "GB"}], "status": "Active", "defaultCurrency": "GBP"}], "pageNumber": 1, "pageSize": 2, "totalResults": 118, "_links": {"self": {"href": "/companies/d95030cd-22b2-482b-9c7b-2980dcc2b1ce/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-25T14:19:08Z", "sourceModifiedDate": "2023-04-17T06:02:46", "id": "11526230", "supplierName": "-", "contactName": "Test 1", "addresses": [{"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-25T14:19:08Z", "sourceModifiedDate": "2023-04-24T06:19:23", "id": "9677150", "supplierName": "-", "contactName": "Test 1", "addresses": [{"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 159, "_links": {"self": {"href": "/companies/071ad738-68f3-4561-afd0-69bab9df0803/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-24T16:07:25Z", "id": "api vendor", "supplierName": "api vendor", "addresses": [], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-24T16:07:25Z", "id": "DUndsRykrmy8kFsc+FvYk29YkJze4zSjGecoF4YcUEhVU7auJ5JkQA0VjXptZ7XQ+D4n6WoxFIkaGY2V/t4flA==", "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", "addresses": [], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 7, "_links": {"self": {"href": "/companies/3691c49e-0db4-4172-b3ab-e4084c365013/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-09-30T10:29:15Z", "sourceModifiedDate": "2017-05-09T00:00:00", "id": "6202387", "supplierName": "Dell", "contactName": "", "emailAddress": "", "phone": "", "addresses": [], "taxNumber": "", "status": "Unknown"}, {"modifiedDate": "2022-09-30T10:29:15Z", "sourceModifiedDate": "1990-01-01T00:00:00", "id": "9338173", "supplierName": "Home", "contactName": "", "emailAddress": "", "phone": "", "addresses": [], "taxNumber": "", "status": "Unknown"}], "pageNumber": 1, "pageSize": 2, "totalResults": 7, "_links": {"self": {"href": "/companies/3a707a99-89da-4b16-a5d6-595333a16352/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-01-30T14:47:02Z", "sourceModifiedDate": "2022-02-04T14:24:43", "id": "779", "supplierName": "Test Vendor", "contactName": "Test Vendor", "emailAddress": "", "phone": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"}, {"modifiedDate": "2023-01-30T14:47:02Z", "sourceModifiedDate": "2021-03-26T09:53:15", "id": "726", "supplierName": "Vendor -.A", "contactName": "Vendor -.A", "emailAddress": "", "phone": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"}], "pageNumber": 1, "pageSize": 2, "totalResults": 6, "_links": {"self": {"href": "/companies/d5074b08-6a34-4b06-a742-236edf5dc4f1/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-26T09:09:03Z", "sourceModifiedDate": "2023-12-16T05:06:44", "id": "A60000-1197760912", "supplierName": "A Cheung Limited", "contactName": "Angela Cheung", "emailAddress": "AC@CheungLimited.com", "phone": "510 555 5723", "addresses": [{"type": "Billing", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "city": "Berkeley", "region": "CA", "postalCode": "94688"}], "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T09:09:03Z", "sourceModifiedDate": "2023-12-16T05:06:44", "id": "A40000-1197774038", "supplierName": "Bank of Anycity", "contactName": "Lisa D. Holzhauser", "emailAddress": "lisah@samplename.com", "phone": "415-555-9135", "addresses": [{"type": "Billing", "line1": "Bank of Anycity, Lisa Holzhauser", "line2": "1935 Main Street", "city": "Middlefield", "region": "CA", "postalCode": "94482"}], "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 54, "_links": {"self": {"href": "/companies/fc72ba08-af13-4474-b28a-01dcfa6cfb51/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-01-18T11:02:36Z", "sourceModifiedDate": "2022-12-07T10:48:18Z", "id": "41", "supplierName": "AI Support", "contactName": "AI Support", "addresses": [{"type": "Billing", "line1": "test", "region": "string", "country": "Djibouti"}], "status": "Active", "defaultCurrency": "GBP"}, {"modifiedDate": "2023-01-18T11:02:36Z", "sourceModifiedDate": "2021-08-31T08:45:02Z", "id": "42", "supplierName": "AI Support 2", "contactName": "AI Support 2", "addresses": [{"type": "Billing", "line1": "test", "region": "string", "country": "DJ"}], "status": "Active", "defaultCurrency": "GBP"}], "pageNumber": 1, "pageSize": 2, "totalResults": 23, "_links": {"self": {"href": "/companies/10818b5e-6e6a-4ed4-a1c5-3e3efe626e87/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-26T09:35:55Z", "sourceModifiedDate": "2023-04-13T01:51:08Z", "id": "129", "supplierName": "Ally Johnson", "contactName": "Miss Smith", "phone": "0728 38474", "addresses": [{"type": "Billing", "line1": "100 London Road", "line2": "Angel", "city": "London", "region": "Greater London", "country": "England", "postalCode": "EC1M"}], "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-26T09:35:55Z", "sourceModifiedDate": "2022-07-06T15:55:28Z", "id": "88", "supplierName": "Andrew Haberbosch", "addresses": [], "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 64, "_links": {"self": {"href": "/companies/5a7f3597-36e1-4216-86fe-289ad36088a6/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-14T09:35:58Z", "id": "776", "supplierName": "Aaren", "contactName": "", "emailAddress": "", "phone": "", "addresses": [{"type": "Unknown", "line1": "", "line2": "", "city": "", "region": "", "country": "Great Britain", "postalCode": ""}], "taxNumber": "", "status": "Archived", "defaultCurrency": "GBP", "metadata": {"isDeleted": true}}, {"modifiedDate": "2022-10-14T09:35:58Z", "id": "914", "supplierName": "Aaren", "contactName": "", "emailAddress": "", "phone": "", "addresses": [{"type": "Unknown", "line1": "", "line2": "", "city": "", "region": "", "country": "Great Britain", "postalCode": ""}], "taxNumber": "", "status": "Archived", "defaultCurrency": "GBP", "metadata": {"isDeleted": true}}], "pageNumber": 1, "pageSize": 2, "totalResults": 943, "_links": {"self": {"href": "/companies/93c21e2d-049c-4d24-b41b-57e61c30b69e/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-30T14:42:38Z", "sourceModifiedDate": "2022-11-25T09:43:54Z", "id": "CON001", "supplierName": "Concept Stationery Supplies", "contactName": "Mark Ramsay", "emailAddress": "newbusinessadvice@sage.com", "phone": "0191 643 4343", "addresses": [{"type": "Delivery", "line1": "66 New Street", "line2": "Ridgeway", "city": "Newcastle Upon Tyne", "region": "", "country": "GB", "postalCode": "NE1 4GF"}, {"type": "Unknown", "line1": "66 New Street", "line2": "Ridgeway", "city": "Newcastle upon Tyne", "region": "", "country": "GB", "postalCode": "NE1 4GF"}], "taxNumber": "GB988 3453 23", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-30T14:42:38Z", "sourceModifiedDate": "2022-12-05T13:37:26Z", "id": "MCN001", "supplierName": "McNally Computer Supplies", "contactName": "Stuart Lynn", "emailAddress": "newbusinessadvice@sage.com", "phone": "0191 415 3434", "addresses": [{"type": "Delivery", "line1": "Station Lane Ind Est", "line2": "Birtley", "city": "Chester le Street", "region": "County Durham", "country": "GB", "postalCode": "DH1 3RG"}, {"type": "Unknown", "line1": "Station Lane Ind Est", "line2": "Birtley", "city": "Chester le Street", "region": "County Durham", "country": "GB", "postalCode": "DH1 3RG"}], "taxNumber": "GB455 2385 34", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 15, "_links": {"self": {"href": "/companies/cf5f2a47-2990-4221-bae6-0c19c86ac304/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2020-02-25T17:23:33Z", "id": "65179671e9ef424caff8b9006cd111c8", "supplierName": "5555 Abdul's Test Name", "contactName": "Main Contact", "addresses": [{"type": "Billing", "country": "United Kingdom (GB)"}], "status": "Active", "defaultCurrency": "GBP"}, {"modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2020-02-13T10:38:19Z", "id": "cf7f44d693904944a6a7cf3de0887964", "supplierName": "Abdi Supplier", "contactName": "Abdi", "emailAddress": "abdisupplier@company.com", "addresses": [{"type": "Billing", "line1": "1 Place House", "city": "London", "country": "United Kingdom (GB)", "postalCode": "WC1X 1AH"}], "status": "Active", "defaultCurrency": "GBP"}], "pageNumber": 1, "pageSize": 2, "totalResults": 64, "_links": {"self": {"href": "/companies/390083e2-351b-407c-a3be-55081c36c182/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-04-04T16:32:20Z", "sourceModifiedDate": "2023-02-16T09:48:27", "id": "3", "supplierName": "ADP", "contactName": "Jones, William", "phone": "214-760-9491", "addresses": [{"type": "Unknown", "line1": "208 S Akard St", "line2": "", "city": "Dallas", "region": "TX", "country": "United States", "postalCode": "75265"}], "registrationNumber": "", "taxNumber": "85-3678274", "status": "Active", "defaultCurrency": "USD", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-04-04T16:32:20Z", "sourceModifiedDate": "2022-06-15T11:38:29", "id": "29", "supplierName": "Advisor Printing", "contactName": "Roach, Nathan", "phone": "130-202-4796", "addresses": [{"type": "Unknown", "line1": "5 Carey Hill", "line2": "", "city": "Drayton Valley", "region": "Alberta", "country": "Canada", "postalCode": "G8V"}], "registrationNumber": "", "taxNumber": "", "status": "Active", "defaultCurrency": "CAD", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 77, "_links": {"self": {"href": "/companies/df02b289-cb16-4964-ac4d-9fd60b04538e/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-11-16T18:15:24Z", "sourceModifiedDate": "2020-04-07T13:28:02Z", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "supplierName": "Computer Shop", "contactName": "", "emailAddress": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"}, {"modifiedDate": "2022-11-16T18:15:24Z", "sourceModifiedDate": "2020-04-07T13:12:40Z", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0NzQx", "supplierName": "Flour Mill", "contactName": "", "emailAddress": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"}], "pageNumber": 1, "pageSize": 2, "totalResults": 9, "_links": {"self": {"href": "/companies/0b22b59d-b4e5-4c35-b03f-88bbbcb41256/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-02-17T18:03:42", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "supplierName": "24 Locks", "emailAddress": "", "addresses": [], "status": "Active", "metadata": {"isDeleted": false}}, {"modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-02-17T18:03:42", "id": "bab779bc-c5fb-42cb-a888-953e8309711c", "supplierName": "7-Eleven", "emailAddress": "", "addresses": [], "status": "Active", "metadata": {"isDeleted": false}}], "pageNumber": 1, "pageSize": 2, "totalResults": 48, "_links": {"self": {"href": "/companies/5ced9667-a310-443a-a711-958d36377141/data/suppliers"}, "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"}}} - 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: {"results": [{"modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-16T13:09:56", "id": "104957000001494001", "supplierName": "Acme Corporation", "emailAddress": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"}, {"modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-06-10T09:07:16", "id": "104957000000648001", "supplierName": "Cool company", "contactName": "Dre", "emailAddress": "", "addresses": [], "status": "Active", "defaultCurrency": "CAD"}], "pageNumber": 1, "pageSize": 2, "totalResults": 6, "_links": {"self": {"href": "/companies/d0b68840-db50-4bc3-b88c-96e225333fea/data/suppliers"}, "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"}}} - 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: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "ClientsApi", "error": "Error parsing query - Malformed query.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - 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: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PullApi", "error": "Error parsing query - Could not resolve property isCompleted on Dataset", "correlationId": "98457fb9956b7f9b4b2fd4f6e23bb5c8", "canBeRetried": "Unknown", "detailedErrorCode": 0} - get-supplier: - Clear Books: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-26T12:38:17Z", "sourceModifiedDate": "1660-11-28T23:18:00", "id": "owQ2Gqgj9f", "supplierName": "Abshire - Kshlerin", "contactName": "Faye Hansen", "emailAddress": "hello@Abshire-Kshlerin.info", "phone": "01338 858162", "addresses": [{"type": "Delivery", "line1": "Suite 431", "line2": "289 Giles Lake", "city": "Cesarmouth", "region": "Northern Ireland", "country": "United Kingdom", "postalCode": "BG40 9GP"}], "registrationNumber": "VYL1XZXR", "taxNumber": "1396267523.0914588", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}} - Dynamics 365 Business Central: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-27T14:21:12Z", "sourceModifiedDate": "2020-11-04T11:44:22Z", "id": "78623f13-931e-eb11-bbf8-0022481b3585", "supplierName": "", "contactName": "", "emailAddress": "", "phone": "", "addresses": [{"type": "Billing", "line1": "", "line2": "", "city": "", "region": "", "country": "GB", "postalCode": ""}], "taxNumber": "", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}} - Exact (Netherlands): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-26T13:32:05Z", "sourceModifiedDate": "2022-07-15T12:01:15Z", "id": "3150917c-1d92-4d77-9018-31b5c4758ca9", "supplierName": "Abe", "contactName": "Kelly's Contact Name", "emailAddress": "sales@kellysupplies.com", "phone": "07999 999999", "addresses": [{"type": "Billing", "line1": "Unit 51", "city": "Bakersfield", "region": "California", "country": "US", "postalCode": "933081"}], "registrationNumber": "8409314368", "status": "Active", "defaultCurrency": "EUR"} - Exact (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-26T13:33:13Z", "sourceModifiedDate": "2017-08-02T10:58:54Z", "id": "0185fea2-0298-445b-909a-0db685118a9e", "supplierName": "a", "addresses": [{"type": "Billing", "country": "GB"}], "status": "Active", "defaultCurrency": "GBP"} - FreeAgent: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-25T14:19:08Z", "sourceModifiedDate": "2023-04-17T06:02:46", "id": "11526230", "supplierName": "-", "contactName": "Test 1", "addresses": [{"type": "Billing", "line1": "1 Place House", "line2": "", "city": "London", "country": "United Kingdom", "postalCode": "WC1X 1AH"}], "status": "Active", "metadata": {"isDeleted": false}} - FreshBooks: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-24T16:07:25Z", "id": "api vendor", "supplierName": "api vendor", "addresses": [], "status": "Active", "metadata": {"isDeleted": false}} - KashFlow: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-09-30T10:29:15Z", "sourceModifiedDate": "2017-05-09T00:00:00", "id": "6202387", "supplierName": "Dell", "contactName": "", "emailAddress": "", "phone": "", "addresses": [], "taxNumber": "", "status": "Unknown"} - Oracle NetSuite: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-01-30T14:47:02Z", "sourceModifiedDate": "2022-02-04T14:24:43", "id": "779", "supplierName": "Test Vendor", "contactName": "Test Vendor", "emailAddress": "", "phone": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"} - QuickBooks Desktop: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-26T09:09:03Z", "sourceModifiedDate": "2023-12-16T05:06:44", "id": "A60000-1197760912", "supplierName": "A Cheung Limited", "contactName": "Angela Cheung", "emailAddress": "AC@CheungLimited.com", "phone": "510 555 5723", "addresses": [{"type": "Billing", "line1": "A Cheung Limited, Angela Cheung", "line2": "3818 Bear Rd. West", "city": "Berkeley", "region": "CA", "postalCode": "94688"}], "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}} - QuickBooks Online: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-01-18T11:02:36Z", "sourceModifiedDate": "2022-12-07T10:48:18Z", "id": "41", "supplierName": "AI Support", "contactName": "AI Support", "addresses": [{"type": "Billing", "line1": "test", "region": "string", "country": "Djibouti"}], "status": "Active", "defaultCurrency": "GBP"} - QuickBooks Online Sandbox: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-26T09:35:55Z", "sourceModifiedDate": "2023-04-13T01:51:08Z", "id": "129", "supplierName": "Ally Johnson", "contactName": "Miss Smith", "phone": "0728 38474", "addresses": [{"type": "Billing", "line1": "100 London Road", "line2": "Angel", "city": "London", "region": "Greater London", "country": "England", "postalCode": "EC1M"}], "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}} - Sage 200cloud: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-14T09:35:58Z", "id": "776", "supplierName": "Aaren", "contactName": "", "emailAddress": "", "phone": "", "addresses": [{"type": "Unknown", "line1": "", "line2": "", "city": "", "region": "", "country": "Great Britain", "postalCode": ""}], "taxNumber": "", "status": "Archived", "defaultCurrency": "GBP", "metadata": {"isDeleted": true}} - Sage 50 (UK): - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-30T14:42:38Z", "sourceModifiedDate": "2022-11-25T09:43:54Z", "id": "CON001", "supplierName": "Concept Stationery Supplies", "contactName": "Mark Ramsay", "emailAddress": "newbusinessadvice@sage.com", "phone": "0191 643 4343", "addresses": [{"type": "Delivery", "line1": "66 New Street", "line2": "Ridgeway", "city": "Newcastle Upon Tyne", "region": "", "country": "GB", "postalCode": "NE1 4GF"}, {"type": "Unknown", "line1": "66 New Street", "line2": "Ridgeway", "city": "Newcastle upon Tyne", "region": "", "country": "GB", "postalCode": "NE1 4GF"}], "taxNumber": "GB988 3453 23", "status": "Active", "defaultCurrency": "GBP", "metadata": {"isDeleted": false}} - Sage Business Cloud Accounting: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-24T14:52:54Z", "sourceModifiedDate": "2020-02-25T17:23:33Z", "id": "65179671e9ef424caff8b9006cd111c8", "supplierName": "5555 Abdul's Test Name", "contactName": "Main Contact", "addresses": [{"type": "Billing", "country": "United Kingdom (GB)"}], "status": "Active", "defaultCurrency": "GBP"} - Sage Intacct: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-04-04T16:32:20Z", "sourceModifiedDate": "2023-02-16T09:48:27", "id": "3", "supplierName": "ADP", "contactName": "Jones, William", "phone": "214-760-9491", "addresses": [{"type": "Unknown", "line1": "208 S Akard St", "line2": "", "city": "Dallas", "region": "TX", "country": "United States", "postalCode": "75265"}], "registrationNumber": "", "taxNumber": "85-3678274", "status": "Active", "defaultCurrency": "USD", "metadata": {"isDeleted": false}} - Wave: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-11-16T18:15:24Z", "sourceModifiedDate": "2020-04-07T13:28:02Z", "id": "QnVzaW5lc3M6ZTI0OGQyZDctMWE5Ni00YTk4LWFkOTEtMDdlMGYyMmNhNmE2O1ZlbmRvcjo2NjA0Nzk0", "supplierName": "Computer Shop", "contactName": "", "emailAddress": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"} - Xero: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2023-03-15T20:36:09Z", "sourceModifiedDate": "2023-02-17T18:03:42", "id": "e4c9d0e2-c285-4e85-b579-6d28b180c730", "supplierName": "24 Locks", "emailAddress": "", "addresses": [], "status": "Active", "metadata": {"isDeleted": false}} - Zoho Books: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "200": - application/json: {"modifiedDate": "2022-10-03T08:40:37Z", "sourceModifiedDate": "2022-09-16T13:09:56", "id": "104957000001494001", "supplierName": "Acme Corporation", "emailAddress": "", "addresses": [], "status": "Active", "defaultCurrency": "GBP"} - Unauthorized: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - responses: - "401": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 401, "service": "PublicApi", "error": "Unauthorized", "correlationId": "7eb40d6b415d7bcd99ce658268284056", "canBeRetried": "Unknown", "detailedErrorCode": 0} - create-supplier: - Sage Intacct: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"id": "73593", "supplierName": "test 20230420 1004", "contactName": "Joe Bloggs", "status": "Active"} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "a724c908-5d52-46dc-ac48-5fbb4ff4bff9", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 416715} - "400": - application/json: {} - "500": - application/json: {} - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-create-supplier: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - query: - allowSyncOnPushComplete: true - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "a724c908-5d52-46dc-ac48-5fbb4ff4bff9", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Failed", "statusCode": 416715} - "400": - application/json: {} - "500": - application/json: {} - update-supplier: - Malformed query: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - forceUpdate: false - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}} - responses: - "400": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - "500": - application/json: {"statusCode": 400, "service": "PublicApi", "error": "Error processing request - not valid.", "correlationId": "bc997528a9d7abb9161ef45f05d38599", "canBeRetried": "Unknown", "detailedErrorCode": 0} - speakeasy-default-update-supplier: - parameters: - path: - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002" - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171" - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab" - query: - allowSyncOnPushComplete: true - forceUpdate: false - requestBody: - application/json: {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}} - responses: - "200": - application/json: {"data": {"modifiedDate": "2022-10-23T00:00:00Z", "sourceModifiedDate": "2022-10-23T00:00:00Z", "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"}], "registrationNumber": "string", "taxNumber": "string", "status": "Unknown", "defaultCurrency": "string", "metadata": {"isDeleted": true}, "supplementalData": {"content": {"property1": {"property1": "", "property2": ""}, "property2": {"property1": "", "property2": ""}}}}, "changes": [{"recordRef": {"dataType": "invoices"}}], "dataType": "invoices", "companyId": "8a210b68-6988-11ed-a1eb-0242ac120002", "pushOperationKey": "221aa977-fea1-4c37-aad6-2bae775afc58", "dataConnectionKey": "2e9d2c44-f675-40ba-8049-353bfcb5e171", "requestedOnUtc": "2022-10-23T00:00:00Z", "completedOnUtc": "2022-10-23T00:00:00Z", "status": "Pending", "statusCode": 663803} - "400": - application/json: {} - "500": - application/json: {} -examplesVersion: 1.0.2 -generatedTests: {} -releaseNotes: | - ## Typescript SDK Changes: - * `codatsyncexpenses.companies.list()`: `response.results[].dataConnections[].integrationKey` **Changed** - * `codatsyncexpenses.companies.create()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncexpenses.companies.replace()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncexpenses.companies.update()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncexpenses.companies.get()`: `response.dataConnections[].integrationKey` **Changed** - * `codatsyncexpenses.connections.list()`: `response.results[].integrationKey` **Changed** - * `codatsyncexpenses.connections.create()`: `response.integrationKey` **Changed** - * `codatsyncexpenses.connections.get()`: `response.integrationKey` **Changed** - * `codatsyncexpenses.connections.unlink()`: `response.integrationKey` **Changed** - * `codatsyncexpenses.connections.createPartnerExpenseConnection()`: `response.integrationKey` **Changed** -generatedFiles: - - .eslintrc.cjs - - .gitattributes - - .npmignore - - CONTRIBUTING.md - - FUNCTIONS.md - - RUNTIMES.md - - USAGE.md - - docs/lib/utils/retryconfig.md - - docs/sdk/models/errors/errormessage.md - - docs/sdk/models/operations/createaccountrequest.md - - docs/sdk/models/operations/createadjustmenttransactionrequest.md - - docs/sdk/models/operations/createbankaccountrequest.md - - docs/sdk/models/operations/createconnectionrequest.md - - docs/sdk/models/operations/createconnectionrequestbody.md - - docs/sdk/models/operations/createcustomerrequest.md - - docs/sdk/models/operations/createexpensetransactionrequest.md - - docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md - - docs/sdk/models/operations/createreimbursableexpensetransactionrequest.md - - docs/sdk/models/operations/createsupplierrequest.md - - docs/sdk/models/operations/createtransfertransactionrequest.md - - docs/sdk/models/operations/deletecompanyrequest.md - - docs/sdk/models/operations/deleteconnectionrequest.md - - docs/sdk/models/operations/getcompanyconfigurationrequest.md - - docs/sdk/models/operations/getcompanyinforequest.md - - docs/sdk/models/operations/getcompanyrequest.md - - docs/sdk/models/operations/getconnectionrequest.md - - docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md - - docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md - - docs/sdk/models/operations/getcustomerrequest.md - - docs/sdk/models/operations/getdatastatusdatastatuses.md - - docs/sdk/models/operations/getdatastatusrequest.md - - docs/sdk/models/operations/getlastsuccessfulsyncrequest.md - - docs/sdk/models/operations/getlatestsyncrequest.md - - docs/sdk/models/operations/getmappingoptionsrequest.md - - docs/sdk/models/operations/getpulloperationrequest.md - - docs/sdk/models/operations/getpushoperationrequest.md - - docs/sdk/models/operations/getsupplierrequest.md - - docs/sdk/models/operations/getsyncbyidrequest.md - - docs/sdk/models/operations/getsynctransactionrequest.md - - docs/sdk/models/operations/listcompaniesrequest.md - - docs/sdk/models/operations/listconnectionsrequest.md - - docs/sdk/models/operations/listcustomersrequest.md - - docs/sdk/models/operations/listpulloperationsrequest.md - - docs/sdk/models/operations/listpushoperationsrequest.md - - docs/sdk/models/operations/listsuppliersrequest.md - - docs/sdk/models/operations/listsyncsrequest.md - - docs/sdk/models/operations/listsynctransactionsrequest.md - - docs/sdk/models/operations/refreshalldatatypesrequest.md - - docs/sdk/models/operations/refreshdatatyperequest.md - - docs/sdk/models/operations/setcompanyconfigurationrequest.md - - docs/sdk/models/operations/unlinkconnectionrequest.md - - docs/sdk/models/operations/unlinkconnectionupdateconnection.md - - docs/sdk/models/operations/updatecompanyrequest.md - - docs/sdk/models/operations/updatecustomerrequest.md - - docs/sdk/models/operations/updateexpensetransactionrequest.md - - docs/sdk/models/operations/updatereimbursableexpensetransactionrequest.md - - docs/sdk/models/operations/updatesupplierrequest.md - - docs/sdk/models/operations/uploadexpenseattachmentrequest.md - - docs/sdk/models/shared/accountingaccount.md - - docs/sdk/models/shared/accountingaddress.md - - docs/sdk/models/shared/accountingaddresstype.md - - docs/sdk/models/shared/accountingbankaccount.md - - docs/sdk/models/shared/accountingcustomer.md - - docs/sdk/models/shared/accountingsupplier.md - - docs/sdk/models/shared/accountmappinginfo.md - - docs/sdk/models/shared/accountmappinginfoaccounttype.md - - docs/sdk/models/shared/accountprototype.md - - docs/sdk/models/shared/accountreference.md - - docs/sdk/models/shared/accountstatus.md - - docs/sdk/models/shared/accounttype.md - - docs/sdk/models/shared/adjustmenttransactionline.md - - docs/sdk/models/shared/adjustmenttransactionrequest.md - - docs/sdk/models/shared/adjustmenttransactionresponse.md - - docs/sdk/models/shared/apaccountref.md - - docs/sdk/models/shared/attachment.md - - docs/sdk/models/shared/attachmentupload.md - - docs/sdk/models/shared/bankaccount.md - - docs/sdk/models/shared/bankaccountdetails.md - - docs/sdk/models/shared/bankaccountreference.md - - docs/sdk/models/shared/bankaccountstatus.md - - docs/sdk/models/shared/bankaccounttype.md - - docs/sdk/models/shared/clientratelimitreachedwebhook.md - - docs/sdk/models/shared/clientratelimitreachedwebhookdata.md - - docs/sdk/models/shared/clientratelimitresetwebhook.md - - docs/sdk/models/shared/clientratelimitresetwebhookdata.md - - docs/sdk/models/shared/clientratelimitwebhook.md - - docs/sdk/models/shared/clientratelimitwebhookpayload.md - - docs/sdk/models/shared/codatfile.md - - docs/sdk/models/shared/companies.md - - docs/sdk/models/shared/company.md - - docs/sdk/models/shared/companyconfiguration.md - - docs/sdk/models/shared/companyinformation.md - - docs/sdk/models/shared/companyinformationtype.md - - docs/sdk/models/shared/companyreference.md - - docs/sdk/models/shared/companyreferencelinks.md - - docs/sdk/models/shared/companyrequestbody.md - - docs/sdk/models/shared/companysyncstatus.md - - docs/sdk/models/shared/connection.md - - docs/sdk/models/shared/connections.md - - docs/sdk/models/shared/contact.md - - docs/sdk/models/shared/createaccountresponse.md - - docs/sdk/models/shared/createaccountresponsemetadata.md - - docs/sdk/models/shared/createaccountresponsevaliddatatypelinks.md - - docs/sdk/models/shared/createbankaccountresponse.md - - docs/sdk/models/shared/createbankaccountresponsebankaccounttype.md - - docs/sdk/models/shared/createcustomerresponse.md - - docs/sdk/models/shared/createexpenseresponse.md - - docs/sdk/models/shared/createreimbursableexpenseresponse.md - - docs/sdk/models/shared/createsupplierresponse.md - - docs/sdk/models/shared/customer.md - - docs/sdk/models/shared/customerdetails.md - - docs/sdk/models/shared/customers.md - - docs/sdk/models/shared/customerstatus.md - - docs/sdk/models/shared/dataconnectionerror.md - - docs/sdk/models/shared/dataconnectionstatus.md - - docs/sdk/models/shared/datasetstatus.md - - docs/sdk/models/shared/datastatus.md - - docs/sdk/models/shared/datatype.md - - docs/sdk/models/shared/datatypes.md - - docs/sdk/models/shared/definitiontransaction.md - - docs/sdk/models/shared/errorstatus.md - - docs/sdk/models/shared/errorvalidation.md - - docs/sdk/models/shared/errorvalidationitem.md - - docs/sdk/models/shared/expensecontactref.md - - docs/sdk/models/shared/expensecontactreftype.md - - docs/sdk/models/shared/expensessyncwebhook.md - - docs/sdk/models/shared/expensessyncwebhookpayload.md - - docs/sdk/models/shared/expensetransaction.md - - docs/sdk/models/shared/expensetransactionline.md - - docs/sdk/models/shared/from.md - - docs/sdk/models/shared/halref.md - - docs/sdk/models/shared/integrationtype.md - - docs/sdk/models/shared/invoiceto.md - - docs/sdk/models/shared/invoicetotype.md - - docs/sdk/models/shared/itemref.md - - docs/sdk/models/shared/items.md - - docs/sdk/models/shared/links.md - - docs/sdk/models/shared/mappingoptions.md - - docs/sdk/models/shared/metadata.md - - docs/sdk/models/shared/phone.md - - docs/sdk/models/shared/phonenumberitems.md - - docs/sdk/models/shared/phonenumbertype.md - - docs/sdk/models/shared/propertiedatatype.md - - docs/sdk/models/shared/pulloperation.md - - docs/sdk/models/shared/pulloperations.md - - docs/sdk/models/shared/pushchangetype.md - - docs/sdk/models/shared/pushfieldvalidation.md - - docs/sdk/models/shared/pushoperation.md - - docs/sdk/models/shared/pushoperationchange.md - - docs/sdk/models/shared/pushoperationref.md - - docs/sdk/models/shared/pushoperations.md - - docs/sdk/models/shared/pushoperationstatus.md - - docs/sdk/models/shared/pushoption.md - - docs/sdk/models/shared/pushoptionchoice.md - - docs/sdk/models/shared/pushoptionproperty.md - - docs/sdk/models/shared/pushoptiontype.md - - docs/sdk/models/shared/pushvalidationinfo.md - - docs/sdk/models/shared/recordref.md - - docs/sdk/models/shared/reimbursableexpensetransaction.md - - docs/sdk/models/shared/reimbursableexpensetransactionline.md - - docs/sdk/models/shared/reimbursementcontactref.md - - docs/sdk/models/shared/security.md - - docs/sdk/models/shared/sourcetype.md - - docs/sdk/models/shared/status.md - - docs/sdk/models/shared/supplementaldata.md - - docs/sdk/models/shared/supplier.md - - docs/sdk/models/shared/supplierdetails.md - - docs/sdk/models/shared/suppliers.md - - docs/sdk/models/shared/supplierstatus.md - - docs/sdk/models/shared/synccompletewebhook.md - - docs/sdk/models/shared/synccompletewebhookdata.md - - docs/sdk/models/shared/syncfailedwebhook.md - - docs/sdk/models/shared/syncfailedwebhookdata.md - - docs/sdk/models/shared/taxratemappinginfo.md - - docs/sdk/models/shared/to.md - - docs/sdk/models/shared/trackingcategorymappinginfo.md - - docs/sdk/models/shared/trackingref.md - - docs/sdk/models/shared/trackingrefadjustmenttransaction.md - - docs/sdk/models/shared/trackingrefadjustmenttransactiondatatype.md - - docs/sdk/models/shared/trackingrefdatatype.md - - docs/sdk/models/shared/transaction.md - - docs/sdk/models/shared/transactions.md - - docs/sdk/models/shared/transactionstatus.md - - docs/sdk/models/shared/transactionstatus1.md - - docs/sdk/models/shared/transfertransactionrequest.md - - docs/sdk/models/shared/transfertransactionrequestaccountreference.md - - docs/sdk/models/shared/transfertransactionresponse.md - - docs/sdk/models/shared/type.md - - docs/sdk/models/shared/updatecustomerresponse.md - - docs/sdk/models/shared/updatecustomerresponseaccountingcustomer.md - - docs/sdk/models/shared/updateexpenserequest.md - - docs/sdk/models/shared/updateexpenserequestbankaccountreference.md - - docs/sdk/models/shared/updateexpenserequesttype.md - - docs/sdk/models/shared/updateexpenseresponse.md - - docs/sdk/models/shared/updatereimbursableexpensetransactionrequest.md - - docs/sdk/models/shared/updatesupplierresponse.md - - docs/sdk/models/shared/updatesupplierresponseaccountingsupplier.md - - docs/sdk/models/shared/validation.md - - docs/sdk/models/shared/validationitem.md - - docs/sdk/models/shared/validdatatypelinks.md - - docs/sdk/models/shared/validfor.md - - docs/sdk/models/shared/validtransactiontypes.md - - docs/sdk/models/shared/weblink.md - - docs/sdks/accounts/README.md - - docs/sdks/adjustments/README.md - - docs/sdks/attachments/README.md - - docs/sdks/bankaccounts/README.md - - docs/sdks/codatsyncexpenses/README.md - - docs/sdks/companies/README.md - - docs/sdks/companyinfo/README.md - - docs/sdks/configuration/README.md - - docs/sdks/connections/README.md - - docs/sdks/customers/README.md - - docs/sdks/expenses/README.md - - docs/sdks/managedata/README.md - - docs/sdks/mappingoptions/README.md - - docs/sdks/pushoperations/README.md - - docs/sdks/reimbursements/README.md - - docs/sdks/suppliers/README.md - - docs/sdks/sync/README.md - - docs/sdks/transactionstatus/README.md - - docs/sdks/transfers/README.md - - jsr.json - - package.json - - src/core.ts - - src/funcs/accountsCreate.ts - - src/funcs/accountsGetCreateModel.ts - - src/funcs/adjustmentsCreate.ts - - src/funcs/attachmentsUpload.ts - - src/funcs/bankAccountsCreate.ts - - src/funcs/bankAccountsGetCreateModel.ts - - src/funcs/companiesCreate.ts - - src/funcs/companiesDelete.ts - - src/funcs/companiesGet.ts - - src/funcs/companiesList.ts - - src/funcs/companiesUpdate.ts - - src/funcs/companyInfoGet.ts - - src/funcs/configurationGet.ts - - src/funcs/configurationSet.ts - - src/funcs/connectionsCreate.ts - - src/funcs/connectionsCreatePartnerExpenseConnection.ts - - src/funcs/connectionsDelete.ts - - src/funcs/connectionsGet.ts - - src/funcs/connectionsList.ts - - src/funcs/connectionsUnlink.ts - - src/funcs/customersCreate.ts - - src/funcs/customersGet.ts - - src/funcs/customersList.ts - - src/funcs/customersUpdate.ts - - src/funcs/expensesCreate.ts - - src/funcs/expensesUpdate.ts - - src/funcs/manageDataGet.ts - - src/funcs/manageDataGetPullOperation.ts - - src/funcs/manageDataListPullOperations.ts - - src/funcs/manageDataRefreshAllDataTypes.ts - - src/funcs/manageDataRefreshDataType.ts - - src/funcs/mappingOptionsGetMappingOptions.ts - - src/funcs/pushOperationsGet.ts - - src/funcs/pushOperationsList.ts - - src/funcs/reimbursementsCreate.ts - - src/funcs/reimbursementsUpdate.ts - - src/funcs/suppliersCreate.ts - - src/funcs/suppliersGet.ts - - src/funcs/suppliersList.ts - - src/funcs/suppliersUpdate.ts - - src/funcs/syncGet.ts - - src/funcs/syncGetLastSuccessfulSync.ts - - src/funcs/syncGetLatestSync.ts - - src/funcs/syncList.ts - - src/funcs/transactionStatusGet.ts - - src/funcs/transactionStatusList.ts - - src/funcs/transfersCreate.ts - - src/hooks/hooks.ts - - src/hooks/index.ts - - src/hooks/types.ts - - src/index.ts - - src/lib/base64.ts - - src/lib/config.ts - - src/lib/dlv.ts - - src/lib/encodings.ts - - src/lib/files.ts - - src/lib/http.ts - - src/lib/is-plain-object.ts - - src/lib/logger.ts - - src/lib/matchers.ts - - src/lib/primitives.ts - - src/lib/retries.ts - - src/lib/schemas.ts - - src/lib/sdks.ts - - src/lib/security.ts - - src/lib/url.ts - - src/sdk/accounts.ts - - src/sdk/adjustments.ts - - src/sdk/attachments.ts - - src/sdk/bankaccounts.ts - - src/sdk/companies.ts - - src/sdk/companyinfo.ts - - src/sdk/configuration.ts - - src/sdk/connections.ts - - src/sdk/customers.ts - - src/sdk/expenses.ts - - src/sdk/index.ts - - src/sdk/managedata.ts - - src/sdk/mappingoptions.ts - - src/sdk/models/errors/errormessage.ts - - src/sdk/models/errors/httpclienterrors.ts - - src/sdk/models/errors/index.ts - - src/sdk/models/errors/sdkerror.ts - - src/sdk/models/errors/sdkvalidationerror.ts - - src/sdk/models/operations/createaccount.ts - - src/sdk/models/operations/createadjustmenttransaction.ts - - src/sdk/models/operations/createbankaccount.ts - - src/sdk/models/operations/createconnection.ts - - src/sdk/models/operations/createcustomer.ts - - src/sdk/models/operations/createexpensetransaction.ts - - src/sdk/models/operations/createpartnerexpenseconnection.ts - - src/sdk/models/operations/createreimbursableexpensetransaction.ts - - src/sdk/models/operations/createsupplier.ts - - src/sdk/models/operations/createtransfertransaction.ts - - src/sdk/models/operations/deletecompany.ts - - src/sdk/models/operations/deleteconnection.ts - - src/sdk/models/operations/getcompany.ts - - src/sdk/models/operations/getcompanyconfiguration.ts - - src/sdk/models/operations/getcompanyinfo.ts - - src/sdk/models/operations/getconnection.ts - - src/sdk/models/operations/getcreatebankaccountsmodel.ts - - src/sdk/models/operations/getcreatechartofaccountsmodel.ts - - src/sdk/models/operations/getcustomer.ts - - src/sdk/models/operations/getdatastatus.ts - - src/sdk/models/operations/getlastsuccessfulsync.ts - - src/sdk/models/operations/getlatestsync.ts - - src/sdk/models/operations/getmappingoptions.ts - - src/sdk/models/operations/getpulloperation.ts - - src/sdk/models/operations/getpushoperation.ts - - src/sdk/models/operations/getsupplier.ts - - src/sdk/models/operations/getsyncbyid.ts - - src/sdk/models/operations/getsynctransaction.ts - - src/sdk/models/operations/index.ts - - src/sdk/models/operations/listcompanies.ts - - src/sdk/models/operations/listconnections.ts - - src/sdk/models/operations/listcustomers.ts - - src/sdk/models/operations/listpulloperations.ts - - src/sdk/models/operations/listpushoperations.ts - - src/sdk/models/operations/listsuppliers.ts - - src/sdk/models/operations/listsyncs.ts - - src/sdk/models/operations/listsynctransactions.ts - - src/sdk/models/operations/refreshalldatatypes.ts - - src/sdk/models/operations/refreshdatatype.ts - - src/sdk/models/operations/setcompanyconfiguration.ts - - src/sdk/models/operations/unlinkconnection.ts - - src/sdk/models/operations/updatecompany.ts - - src/sdk/models/operations/updatecustomer.ts - - src/sdk/models/operations/updateexpensetransaction.ts - - src/sdk/models/operations/updatereimbursableexpensetransaction.ts - - src/sdk/models/operations/updatesupplier.ts - - src/sdk/models/operations/uploadexpenseattachment.ts - - src/sdk/models/shared/accountingaddresstype.ts - - src/sdk/models/shared/accountmappinginfo.ts - - src/sdk/models/shared/accountprototype.ts - - src/sdk/models/shared/accountstatus.ts - - src/sdk/models/shared/accounttype.ts - - src/sdk/models/shared/adjustmenttransactionline.ts - - src/sdk/models/shared/adjustmenttransactionrequest.ts - - src/sdk/models/shared/adjustmenttransactionresponse.ts - - src/sdk/models/shared/apaccountref.ts - - src/sdk/models/shared/attachment.ts - - src/sdk/models/shared/attachmentupload.ts - - src/sdk/models/shared/bankaccount.ts - - src/sdk/models/shared/bankaccountdetails.ts - - src/sdk/models/shared/bankaccountstatus.ts - - src/sdk/models/shared/clientratelimitreachedwebhook.ts - - src/sdk/models/shared/clientratelimitreachedwebhookdata.ts - - src/sdk/models/shared/clientratelimitresetwebhook.ts - - src/sdk/models/shared/clientratelimitresetwebhookdata.ts - - src/sdk/models/shared/clientratelimitwebhook.ts - - src/sdk/models/shared/clientratelimitwebhookpayload.ts - - src/sdk/models/shared/codatfile.ts - - src/sdk/models/shared/companies.ts - - src/sdk/models/shared/company.ts - - src/sdk/models/shared/companyconfiguration.ts - - src/sdk/models/shared/companyinformation.ts - - src/sdk/models/shared/companyreference.ts - - src/sdk/models/shared/companyrequestbody.ts - - src/sdk/models/shared/companysyncstatus.ts - - src/sdk/models/shared/connection.ts - - src/sdk/models/shared/connections.ts - - src/sdk/models/shared/contact.ts - - src/sdk/models/shared/createaccountresponse.ts - - src/sdk/models/shared/createbankaccountresponse.ts - - src/sdk/models/shared/createcustomerresponse.ts - - src/sdk/models/shared/createexpenseresponse.ts - - src/sdk/models/shared/createreimbursableexpenseresponse.ts - - src/sdk/models/shared/createsupplierresponse.ts - - src/sdk/models/shared/customer.ts - - src/sdk/models/shared/customerdetails.ts - - src/sdk/models/shared/customers.ts - - src/sdk/models/shared/customerstatus.ts - - src/sdk/models/shared/dataconnectionerror.ts - - src/sdk/models/shared/dataconnectionstatus.ts - - src/sdk/models/shared/datastatus.ts - - src/sdk/models/shared/datatype.ts - - src/sdk/models/shared/definitiontransaction.ts - - src/sdk/models/shared/errorvalidation.ts - - src/sdk/models/shared/errorvalidationitem.ts - - src/sdk/models/shared/expensecontactref.ts - - src/sdk/models/shared/expensessyncwebhook.ts - - src/sdk/models/shared/expensessyncwebhookpayload.ts - - src/sdk/models/shared/expensetransaction.ts - - src/sdk/models/shared/expensetransactionline.ts - - src/sdk/models/shared/halref.ts - - src/sdk/models/shared/index.ts - - src/sdk/models/shared/integrationtype.ts - - src/sdk/models/shared/invoiceto.ts - - src/sdk/models/shared/itemref.ts - - src/sdk/models/shared/items.ts - - src/sdk/models/shared/links.ts - - src/sdk/models/shared/mappingoptions.ts - - src/sdk/models/shared/metadata.ts - - src/sdk/models/shared/phonenumberitems.ts - - src/sdk/models/shared/phonenumbertype.ts - - src/sdk/models/shared/propertiedatatype.ts - - src/sdk/models/shared/pulloperation.ts - - src/sdk/models/shared/pulloperations.ts - - src/sdk/models/shared/pushchangetype.ts - - src/sdk/models/shared/pushfieldvalidation.ts - - src/sdk/models/shared/pushoperation.ts - - src/sdk/models/shared/pushoperationchange.ts - - src/sdk/models/shared/pushoperationref.ts - - src/sdk/models/shared/pushoperations.ts - - src/sdk/models/shared/pushoperationstatus.ts - - src/sdk/models/shared/pushoption.ts - - src/sdk/models/shared/pushoptionchoice.ts - - src/sdk/models/shared/pushoptionproperty.ts - - src/sdk/models/shared/pushoptiontype.ts - - src/sdk/models/shared/pushvalidationinfo.ts - - src/sdk/models/shared/recordref.ts - - src/sdk/models/shared/reimbursableexpensetransaction.ts - - src/sdk/models/shared/reimbursableexpensetransactionline.ts - - src/sdk/models/shared/reimbursementcontactref.ts - - src/sdk/models/shared/security.ts - - src/sdk/models/shared/status.ts - - src/sdk/models/shared/supplementaldata.ts - - src/sdk/models/shared/supplier.ts - - src/sdk/models/shared/supplierdetails.ts - - src/sdk/models/shared/suppliers.ts - - src/sdk/models/shared/supplierstatus.ts - - src/sdk/models/shared/synccompletewebhook.ts - - src/sdk/models/shared/synccompletewebhookdata.ts - - src/sdk/models/shared/syncfailedwebhook.ts - - src/sdk/models/shared/syncfailedwebhookdata.ts - - src/sdk/models/shared/taxratemappinginfo.ts - - src/sdk/models/shared/trackingcategorymappinginfo.ts - - src/sdk/models/shared/trackingref.ts - - src/sdk/models/shared/trackingrefadjustmenttransaction.ts - - src/sdk/models/shared/transaction.ts - - src/sdk/models/shared/transactions.ts - - src/sdk/models/shared/transactionstatus.ts - - src/sdk/models/shared/transfertransactionrequest.ts - - src/sdk/models/shared/transfertransactionresponse.ts - - src/sdk/models/shared/updatecustomerresponse.ts - - src/sdk/models/shared/updateexpenserequest.ts - - src/sdk/models/shared/updateexpenseresponse.ts - - src/sdk/models/shared/updatereimbursableexpensetransactionrequest.ts - - src/sdk/models/shared/updatesupplierresponse.ts - - src/sdk/models/shared/validation.ts - - src/sdk/models/shared/validationitem.ts - - src/sdk/models/shared/validfor.ts - - src/sdk/models/shared/validtransactiontypes.ts - - src/sdk/pushoperations.ts - - src/sdk/reimbursements.ts - - src/sdk/sdk.ts - - src/sdk/suppliers.ts - - src/sdk/sync.ts - - src/sdk/transactionstatus.ts - - src/sdk/transfers.ts - - src/sdk/types/blobs.ts - - src/sdk/types/constdatetime.ts - - src/sdk/types/decimal.ts - - src/sdk/types/enums.ts - - src/sdk/types/fp.ts - - src/sdk/types/index.ts - - src/sdk/types/operations.ts - - src/sdk/types/rfcdate.ts - - src/sdk/types/streams.ts - - tsconfig.json diff --git a/sync-for-expenses/.speakeasy/gen.yaml b/sync-for-expenses/.speakeasy/gen.yaml deleted file mode 100644 index fc0ebcdc8..000000000 --- a/sync-for-expenses/.speakeasy/gen.yaml +++ /dev/null @@ -1,91 +0,0 @@ -configVersion: 2.0.0 -generation: - sdkClassName: CodatSyncExpenses - maintainOpenAPIOrder: true - usageSnippets: - optionalPropertyRendering: withExample - sdkInitStyle: constructor - useClassNamesForArrayFields: true - fixes: - nameResolutionDec2023: true - nameResolutionFeb2025: false - parameterOrderingFeb2024: true - requestResponseComponentNamesFeb2024: true - securityFeb2025: false - sharedErrorComponentsApr2025: false - sharedNestedComponentsJan2026: false - nameOverrideFeb2026: false - auth: - oAuth2ClientCredentialsEnabled: false - oAuth2PasswordEnabled: false - hoistGlobalSecurity: true - schemas: - allOfMergeStrategy: shallowMerge - requestBodyFieldName: "" - versioningStrategy: automatic - persistentEdits: {} - tests: - generateTests: true - generateNewTests: false - skipResponseBodyAssertions: false - telemetryEnabled: true -typescript: - version: 7.1.1 - acceptHeaderEnum: true - additionalDependencies: - dependencies: {} - devDependencies: {} - peerDependencies: {} - additionalPackageJSON: {} - additionalScripts: {} - alwaysIncludeInboundAndOutbound: false - author: Codat - baseErrorName: CodatSyncExpensesError - clientServerStatusCodesAsErrors: true - constFieldsAlwaysOptional: false - defaultErrorName: SDKError - description: Push expenses to accounting platforms. - enableCustomCodeRegions: false - enableMCPServer: false - enableReactQuery: false - enumFormat: union - exportZodModelNamespace: false - fixEnumNameSanitization: false - flatAdditionalProperties: false - flattenGlobalSecurity: true - flatteningOrder: body-first - formStringArrayEncodeMode: encoded-string - forwardCompatibleEnumsByDefault: false - forwardCompatibleUnionsByDefault: "false" - generateExamples: true - imports: - option: openapi - paths: - callbacks: sdk/models/callbacks - errors: sdk/models/errors - operations: sdk/models/operations - shared: sdk/models/shared - webhooks: sdk/models/webhooks - inferUnionDiscriminators: true - inputModelSuffix: input - jsonpath: legacy - laxMode: strict - legacyFileNaming: true - maxMethodParams: 0 - methodArguments: infer-optional-args - modelPropertyCasing: camel - moduleFormat: commonjs - multipartArrayFormat: legacy - outputModelSuffix: output - packageName: '@codat/sync-for-expenses' - preApplyUnionDiscriminators: true - preserveModelFieldNames: false - responseFormat: flat - sseFlatResponse: false - templateVersion: v2 - unionStrategy: left-to-right - usageSDKInitImports: [] - useIndexModules: true - useOxlint: false - useTsgo: false - zodVersion: v3 diff --git a/sync-for-expenses/RELEASES.md b/sync-for-expenses/RELEASES.md index edd4c2c60..673d49492 100644 --- a/sync-for-expenses/RELEASES.md +++ b/sync-for-expenses/RELEASES.md @@ -798,4 +798,14 @@ Based on: ### Generated - [typescript v7.1.1] sync-for-expenses ### Releases -- [NPM v7.1.1] https://www.npmjs.com/package/@codat/sync-for-expenses/v/7.1.1 - sync-for-expenses \ No newline at end of file +- [NPM v7.1.1] https://www.npmjs.com/package/@codat/sync-for-expenses/v/7.1.1 - sync-for-expenses + +## 2026-08-05 19:30:22 +### Changes +Based on: +- OpenAPI Doc prealpha https://raw.githubusercontent.com/codatio/oas/main/yaml/Codat-Sync-Expenses.yaml +- codat sdk-codegen 1b5626f25df09d713121c5e8a048d9b44b3b7178 https://github.com/codat-spikes/sdk-codegen +### Generated +- [typescript v7.1.2] sync-for-expenses +### Releases +- [NPM v7.1.2] https://www.npmjs.com/package/@codat/sync-for-expenses/v/7.1.2 - sync-for-expenses diff --git a/sync-for-expenses/USAGE.md b/sync-for-expenses/USAGE.md index f7d004f57..ab5fc083e 100644 --- a/sync-for-expenses/USAGE.md +++ b/sync-for-expenses/USAGE.md @@ -1,22 +1,31 @@ - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); - -``` + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountPrototype: { + nominalCode: "610", + name: "Accounts Receivable", + description: "Invoices the business has issued but has not yet collected payment on.", + fullyQualifiedCategory: "Asset.Current", + fullyQualifiedName: "Cash On Hand", + currency: "GBP", + currentBalance: 0, + type: "Asset", + status: "Active", + }, + }); + + console.log(result); +} + +run(); +``` \ No newline at end of file diff --git a/sync-for-expenses/docs/lib/utils/retryconfig.md b/sync-for-expenses/docs/lib/utils/retryconfig.md index 08f95f455..69da01b9f 100644 --- a/sync-for-expenses/docs/lib/utils/retryconfig.md +++ b/sync-for-expenses/docs/lib/utils/retryconfig.md @@ -1,24 +1,24 @@ -# RetryConfig - -Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. - -## Fields - -| Name | Type | Description | Example | -| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | -| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | -| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | -| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | - -## BackoffStrategy - -The backoff strategy allows retrying a request with an exponential backoff between each retry. - -### Fields - -| Name | Type | Description | Example | -| ------------------ | ------------ | ----------------------------------------- | -------- | -| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | -| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | -| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | +# RetryConfig + +Allows customizing the default retry configuration. It is only permitted in methods that accept retry policies. + +## Fields + +| Name | Type | Description | Example | +| ------------------------- | ----------------------------------- | ------------------------------------------------------------------------------------------ | ----------- | +| `strategy` | `"backoff" | "none"` | The retry strategy to use. | `"backoff"` | +| `backoff` | [BackoffStrategy](#backoffstrategy) | When strategy is "backoff", this configurates for the backoff parameters. | | +| `retryConnectionErrors` | `*boolean*` | When strategy is "backoff", this determines whether or not to retry on connection errors. | `true` | + +## BackoffStrategy + +The backoff strategy allows retrying a request with an exponential backoff between each retry. + +### Fields + +| Name | Type | Description | Example | +| ------------------ | ------------ | ----------------------------------------- | -------- | +| `initialInterval` | `*number*` | The initial interval in milliseconds. | `500` | +| `maxInterval` | `*number*` | The maximum interval in milliseconds. | `60000` | +| `exponent` | `*number*` | The exponent to use for the backoff. | `1.5` | | `maxElapsedTime` | `*number*` | The maximum elapsed time in milliseconds. | `300000` | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/errors/errormessage.md b/sync-for-expenses/docs/sdk/models/errors/errormessage.md index 3e89159c2..fdc8a0b05 100644 --- a/sync-for-expenses/docs/sdk/models/errors/errormessage.md +++ b/sync-for-expenses/docs/sdk/models/errors/errormessage.md @@ -1,23 +1,21 @@ -# ErrorMessage - -Your `query` parameter was not correctly formed - -## Example Usage - -```typescript -import { ErrorMessage } from "@codat/sync-for-expenses/sdk/models/errors"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | -| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | -| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | -| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | -| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | -| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | +# ErrorMessage + +## Example Usage + +```typescript +import { ErrorMessage } from "@codat/sync-for-expenses/sdk/models/errors"; + +// No examples available for this model +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `statusCode` | *number* | :heavy_minus_sign: | The HTTP status code returned by the error. | +| `service` | *string* | :heavy_minus_sign: | Codat's service the returned the error. | +| `error` | *string* | :heavy_minus_sign: | A brief description of the error. | +| `correlationId` | *string* | :heavy_minus_sign: | Unique identifier used to propagate to all downstream services and determine the source of the error. | +| `validation` | [shared.ErrorValidation](../../../sdk/models/shared/errorvalidation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. | +| `canBeRetried` | *string* | :heavy_minus_sign: | `True` if the error occurred transiently and can be retried. | | `detailedErrorCode` | *number* | :heavy_minus_sign: | Machine readable error code used to automate processes based on the code returned. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createaccountrequest.md b/sync-for-expenses/docs/sdk/models/operations/createaccountrequest.md index 27b0dab27..bfce9c141 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createaccountrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createaccountrequest.md @@ -1,22 +1,22 @@ -# CreateAccountRequest - -## Example Usage - -```typescript -import { CreateAccountRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## 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 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +# CreateAccountRequest + +## Example Usage + +```typescript +import { CreateAccountRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | | `accountPrototype` | [shared.AccountPrototype](../../../sdk/models/shared/accountprototype.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createadjustmenttransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/createadjustmenttransactionrequest.md index 54b394d04..3f4fcf3a6 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createadjustmenttransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createadjustmenttransactionrequest.md @@ -1,18 +1,18 @@ -# CreateAdjustmentTransactionRequest - -## Example Usage - -```typescript -import { CreateAdjustmentTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateAdjustmentTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateAdjustmentTransactionRequest + +## Example Usage + +```typescript +import { CreateAdjustmentTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateAdjustmentTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [shared.AdjustmentTransactionRequest](../../../sdk/models/shared/adjustmenttransactionrequest.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createbankaccountrequest.md b/sync-for-expenses/docs/sdk/models/operations/createbankaccountrequest.md index e4a966d67..efed6c550 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createbankaccountrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createbankaccountrequest.md @@ -1,22 +1,22 @@ -# CreateBankAccountRequest - -## Example Usage - -```typescript -import { CreateBankAccountRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateBankAccountRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## 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 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `bankAccount` | [shared.BankAccount](../../../sdk/models/shared/bankaccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# CreateBankAccountRequest + +## Example Usage + +```typescript +import { CreateBankAccountRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateBankAccountRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `bankAccount` | [shared.BankAccount](../../../sdk/models/shared/bankaccount.md) | :heavy_minus_sign: | > **Accessing Bank Accounts through Banking API**
>
> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators.
>
> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type.

## Overview

A list of bank accounts associated with a company and a specific data connection.

Bank accounts data includes:
* The name and ID of the account in the accounting software.
* The currency and balance of the account.
* The sort code and account number. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createconnectionrequest.md b/sync-for-expenses/docs/sdk/models/operations/createconnectionrequest.md index b4131fdf4..a36149191 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createconnectionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createconnectionrequest.md @@ -1,18 +1,18 @@ -# CreateConnectionRequest - -## Example Usage - -```typescript -import { CreateConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateConnectionRequest + +## Example Usage + +```typescript +import { CreateConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [operations.CreateConnectionRequestBody](../../../sdk/models/operations/createconnectionrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createconnectionrequestbody.md b/sync-for-expenses/docs/sdk/models/operations/createconnectionrequestbody.md index 2905789d1..bf3c46073 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createconnectionrequestbody.md +++ b/sync-for-expenses/docs/sdk/models/operations/createconnectionrequestbody.md @@ -1,17 +1,17 @@ -# CreateConnectionRequestBody - -## Example Usage - -```typescript -import { CreateConnectionRequestBody } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateConnectionRequestBody = { - platformKey: "gbol", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# CreateConnectionRequestBody + +## Example Usage + +```typescript +import { CreateConnectionRequestBody } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateConnectionRequestBody = { + platformKey: "gbol", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `platformKey` | *string* | :heavy_minus_sign: | A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. | gbol | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createcustomerrequest.md b/sync-for-expenses/docs/sdk/models/operations/createcustomerrequest.md index a128fffd9..d5105320a 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createcustomerrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createcustomerrequest.md @@ -1,22 +1,22 @@ -# CreateCustomerRequest - -## Example Usage - -```typescript -import { CreateCustomerRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateCustomerRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## 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 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `customer` | [shared.Customer](../../../sdk/models/shared/customer.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# CreateCustomerRequest + +## Example Usage + +```typescript +import { CreateCustomerRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateCustomerRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `customer` | [shared.Customer](../../../sdk/models/shared/customer.md) | :heavy_minus_sign: | ## Overview

A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers).

Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice).
| | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createexpensetransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/createexpensetransactionrequest.md index 8f18821dd..ad1228940 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createexpensetransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createexpensetransactionrequest.md @@ -1,18 +1,18 @@ -# CreateExpenseTransactionRequest - -## Example Usage - -```typescript -import { CreateExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateExpenseTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateExpenseTransactionRequest + +## Example Usage + +```typescript +import { CreateExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateExpenseTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [shared.ExpenseTransaction](../../../sdk/models/shared/expensetransaction.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md b/sync-for-expenses/docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md index b1c1be5be..7133cda2b 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md @@ -1,17 +1,17 @@ -# CreatePartnerExpenseConnectionRequest - -## Example Usage - -```typescript -import { CreatePartnerExpenseConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreatePartnerExpenseConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# CreatePartnerExpenseConnectionRequest + +## Example Usage + +```typescript +import { CreatePartnerExpenseConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreatePartnerExpenseConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createreimbursableexpensetransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/createreimbursableexpensetransactionrequest.md index af3df215b..d77a15876 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createreimbursableexpensetransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createreimbursableexpensetransactionrequest.md @@ -1,18 +1,18 @@ -# CreateReimbursableExpenseTransactionRequest - -## Example Usage - -```typescript -import { CreateReimbursableExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateReimbursableExpenseTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# CreateReimbursableExpenseTransactionRequest + +## Example Usage + +```typescript +import { CreateReimbursableExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateReimbursableExpenseTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `requestBody` | [shared.ReimbursableExpenseTransaction](../../../sdk/models/shared/reimbursableexpensetransaction.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createsupplierrequest.md b/sync-for-expenses/docs/sdk/models/operations/createsupplierrequest.md index f6ca36308..d545bb3e9 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createsupplierrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createsupplierrequest.md @@ -1,22 +1,22 @@ -# CreateSupplierRequest - -## Example Usage - -```typescript -import { CreateSupplierRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateSupplierRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## 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 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `supplier` | [shared.Supplier](../../../sdk/models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | \ No newline at end of file +# CreateSupplierRequest + +## Example Usage + +```typescript +import { CreateSupplierRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateSupplierRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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 | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `supplier` | [shared.Supplier](../../../sdk/models/shared/supplier.md) | :heavy_minus_sign: | ## Overview

From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). | {
"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"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/createtransfertransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/createtransfertransactionrequest.md index c931c5332..5a92f2f5d 100644 --- a/sync-for-expenses/docs/sdk/models/operations/createtransfertransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/createtransfertransactionrequest.md @@ -1,20 +1,20 @@ -# CreateTransferTransactionRequest - -## Example Usage - -```typescript -import { CreateTransferTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: CreateTransferTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | +# CreateTransferTransactionRequest + +## Example Usage + +```typescript +import { CreateTransferTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: CreateTransferTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | | `transferTransactionRequest` | [shared.TransferTransactionRequest](../../../sdk/models/shared/transfertransactionrequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/deletecompanyrequest.md b/sync-for-expenses/docs/sdk/models/operations/deletecompanyrequest.md index a7c499d90..74895cee2 100644 --- a/sync-for-expenses/docs/sdk/models/operations/deletecompanyrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/deletecompanyrequest.md @@ -1,17 +1,17 @@ -# DeleteCompanyRequest - -## Example Usage - -```typescript -import { DeleteCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: DeleteCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# DeleteCompanyRequest + +## Example Usage + +```typescript +import { DeleteCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: DeleteCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/deleteconnectionrequest.md b/sync-for-expenses/docs/sdk/models/operations/deleteconnectionrequest.md index 3bdb93d28..08e8629a0 100644 --- a/sync-for-expenses/docs/sdk/models/operations/deleteconnectionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/deleteconnectionrequest.md @@ -1,19 +1,19 @@ -# DeleteConnectionRequest - -## Example Usage - -```typescript -import { DeleteConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: DeleteConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# DeleteConnectionRequest + +## Example Usage + +```typescript +import { DeleteConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: DeleteConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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/sync-for-expenses/docs/sdk/models/operations/getcompanyconfigurationrequest.md b/sync-for-expenses/docs/sdk/models/operations/getcompanyconfigurationrequest.md index 1b6830504..312091033 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getcompanyconfigurationrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getcompanyconfigurationrequest.md @@ -1,17 +1,17 @@ -# GetCompanyConfigurationRequest - -## Example Usage - -```typescript -import { GetCompanyConfigurationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetCompanyConfigurationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyConfigurationRequest + +## Example Usage + +```typescript +import { GetCompanyConfigurationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetCompanyConfigurationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getcompanyinforequest.md b/sync-for-expenses/docs/sdk/models/operations/getcompanyinforequest.md index 5dcdfd81f..da1b404fe 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getcompanyinforequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getcompanyinforequest.md @@ -1,17 +1,17 @@ -# GetCompanyInfoRequest - -## Example Usage - -```typescript -import { GetCompanyInfoRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetCompanyInfoRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyInfoRequest + +## Example Usage + +```typescript +import { GetCompanyInfoRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetCompanyInfoRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getcompanyrequest.md b/sync-for-expenses/docs/sdk/models/operations/getcompanyrequest.md index dc098ef99..8eec91f10 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getcompanyrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getcompanyrequest.md @@ -1,17 +1,17 @@ -# GetCompanyRequest - -## Example Usage - -```typescript -import { GetCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetCompanyRequest + +## Example Usage + +```typescript +import { GetCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getconnectionrequest.md b/sync-for-expenses/docs/sdk/models/operations/getconnectionrequest.md index 4479cf98b..2ae98ca03 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getconnectionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getconnectionrequest.md @@ -1,19 +1,19 @@ -# GetConnectionRequest - -## Example Usage - -```typescript -import { GetConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetConnectionRequest + +## Example Usage + +```typescript +import { GetConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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/sync-for-expenses/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md b/sync-for-expenses/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md index 2bb1328eb..52044f4ec 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getcreatebankaccountsmodelrequest.md @@ -1,19 +1,19 @@ -# GetCreateBankAccountsModelRequest - -## Example Usage - -```typescript -import { GetCreateBankAccountsModelRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetCreateBankAccountsModelRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCreateBankAccountsModelRequest + +## Example Usage + +```typescript +import { GetCreateBankAccountsModelRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetCreateBankAccountsModelRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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/sync-for-expenses/docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md b/sync-for-expenses/docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md index a65ef7278..37f9b5874 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md @@ -1,19 +1,19 @@ -# GetCreateChartOfAccountsModelRequest - -## Example Usage - -```typescript -import { GetCreateChartOfAccountsModelRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetCreateChartOfAccountsModelRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCreateChartOfAccountsModelRequest + +## Example Usage + +```typescript +import { GetCreateChartOfAccountsModelRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetCreateChartOfAccountsModelRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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/sync-for-expenses/docs/sdk/models/operations/getcustomerrequest.md b/sync-for-expenses/docs/sdk/models/operations/getcustomerrequest.md index 87bae7537..f48e14794 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getcustomerrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getcustomerrequest.md @@ -1,19 +1,19 @@ -# GetCustomerRequest - -## Example Usage - -```typescript -import { GetCustomerRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetCustomerRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetCustomerRequest + +## Example Usage + +```typescript +import { GetCustomerRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetCustomerRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `customerId` | *string* | :heavy_check_mark: | Unique identifier for a customer. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getdatastatusdatastatuses.md b/sync-for-expenses/docs/sdk/models/operations/getdatastatusdatastatuses.md index e12b6f663..4768d1254 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getdatastatusdatastatuses.md +++ b/sync-for-expenses/docs/sdk/models/operations/getdatastatusdatastatuses.md @@ -1,361 +1,15 @@ -# GetDataStatusDataStatuses - -OK - -## Example Usage - -```typescript -import { GetDataStatusDataStatuses } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetDataStatusDataStatuses = { - accountTransactions: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - balanceSheet: { - dataType: "bankAccounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Queued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankAccounts: { - dataType: "chartOfAccounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankTransactions: { - dataType: "commerce-paymentMethods", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "FetchError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - billCreditNotes: { - dataType: "paymentMethods", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - billPayments: { - dataType: "commerce-payments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ValidationQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bills: { - dataType: "paymentMethods", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Validating", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - cashFlowStatement: { - dataType: "journals", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Initial", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - chartOfAccounts: { - dataType: "suppliers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Queued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - company: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - creditNotes: { - dataType: "journals", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Fetching", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - customers: { - dataType: "trackingCategories", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "AuthError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - directCosts: { - dataType: "billPayments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Fetching", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - directIncomes: { - dataType: "purchaseOrders", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Queued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - invoices: { - dataType: "creditNotes", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - itemReceipts: { - dataType: "bankTransactions", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - items: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - journalEntries: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PrerequisiteNotMet", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - journals: { - dataType: "commerce-transactions", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Mapping", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - paymentMethods: { - dataType: "billPayments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - payments: { - dataType: "payments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Validating", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - profitAndLoss: { - dataType: "directCosts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ValidationQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - purchaseOrders: { - dataType: "bills", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - salesOrders: { - dataType: "commerce-products", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Queued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - suppliers: { - dataType: "transfers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "AuthError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - taxRates: { - dataType: "company", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Validating", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - trackingCategories: { - dataType: "bills", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - transfers: { - dataType: "commerce-payments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Processing", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingAccountBalances: { - dataType: "items", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingAccounts: { - dataType: "trackingCategories", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingTransactionCategories: { - dataType: "journals", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "InternalError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - bankingTransactions: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "FetchError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceCompanyInfo: { - dataType: "billPayments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceCustomers: { - dataType: "suppliers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Initial", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceDisputes: { - dataType: "banking-transactions", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceLocations: { - dataType: "transfers", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PermissionsError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceOrders: { - dataType: "billPayments", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "FetchError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commercePaymentMethods: { - dataType: "trackingCategories", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "NotSupported", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commercePayments: { - dataType: "invoices", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "ProcessingError", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceProductCategories: { - dataType: "bills", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceProducts: { - dataType: "banking-accounts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Validating", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceTaxComponents: { - dataType: "items", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "PrerequisiteNotMet", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, - commerceTransactions: { - dataType: "company", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "MapQueued", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `accountTransactions` | [shared.DataStatus](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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](../../../sdk/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 +# GetDataStatusDataStatuses + +## Example Usage + +```typescript +import { GetDataStatusDataStatuses } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetDataStatusDataStatuses = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getdatastatusrequest.md b/sync-for-expenses/docs/sdk/models/operations/getdatastatusrequest.md index f9a15f355..9e7dd3f00 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getdatastatusrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getdatastatusrequest.md @@ -1,17 +1,17 @@ -# GetDataStatusRequest - -## Example Usage - -```typescript -import { GetDataStatusRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetDataStatusRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetDataStatusRequest + +## Example Usage + +```typescript +import { GetDataStatusRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetDataStatusRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getlastsuccessfulsyncrequest.md b/sync-for-expenses/docs/sdk/models/operations/getlastsuccessfulsyncrequest.md index d9a3a8b77..dd2e15dd5 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getlastsuccessfulsyncrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getlastsuccessfulsyncrequest.md @@ -1,17 +1,17 @@ -# GetLastSuccessfulSyncRequest - -## Example Usage - -```typescript -import { GetLastSuccessfulSyncRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetLastSuccessfulSyncRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetLastSuccessfulSyncRequest + +## Example Usage + +```typescript +import { GetLastSuccessfulSyncRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetLastSuccessfulSyncRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getlatestsyncrequest.md b/sync-for-expenses/docs/sdk/models/operations/getlatestsyncrequest.md index dd432ec98..4881f64e8 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getlatestsyncrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getlatestsyncrequest.md @@ -1,17 +1,17 @@ -# GetLatestSyncRequest - -## Example Usage - -```typescript -import { GetLatestSyncRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetLatestSyncRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetLatestSyncRequest + +## Example Usage + +```typescript +import { GetLatestSyncRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetLatestSyncRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getmappingoptionsrequest.md b/sync-for-expenses/docs/sdk/models/operations/getmappingoptionsrequest.md index 43ecd0085..af7ea4c2f 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getmappingoptionsrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getmappingoptionsrequest.md @@ -1,17 +1,17 @@ -# GetMappingOptionsRequest - -## Example Usage - -```typescript -import { GetMappingOptionsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetMappingOptionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# GetMappingOptionsRequest + +## Example Usage + +```typescript +import { GetMappingOptionsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetMappingOptionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getpulloperationrequest.md b/sync-for-expenses/docs/sdk/models/operations/getpulloperationrequest.md index e8be4affa..b0633e3c7 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getpulloperationrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getpulloperationrequest.md @@ -1,19 +1,18 @@ -# GetPullOperationRequest - -## Example Usage - -```typescript -import { GetPullOperationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetPullOperationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "2e524c49-3726-44e5-9563-576172cc15aa", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetPullOperationRequest + +## Example Usage + +```typescript +import { GetPullOperationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetPullOperationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | ---------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `datasetId` | *string* | :heavy_check_mark: | Unique identifier for the dataset that completed its sync. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getpushoperationrequest.md b/sync-for-expenses/docs/sdk/models/operations/getpushoperationrequest.md index 36492fcc3..06b467611 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getpushoperationrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getpushoperationrequest.md @@ -1,19 +1,18 @@ -# GetPushOperationRequest - -## Example Usage - -```typescript -import { GetPushOperationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetPushOperationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "14a4a880-31a4-4db5-88cb-40c00b392985", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetPushOperationRequest + +## Example Usage + +```typescript +import { GetPushOperationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetPushOperationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `pushOperationKey` | *string* | :heavy_check_mark: | Push operation key. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getsupplierrequest.md b/sync-for-expenses/docs/sdk/models/operations/getsupplierrequest.md index 0496c3d26..1366b6a1d 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getsupplierrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getsupplierrequest.md @@ -1,19 +1,19 @@ -# GetSupplierRequest - -## Example Usage - -```typescript -import { GetSupplierRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetSupplierRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetSupplierRequest + +## Example Usage + +```typescript +import { GetSupplierRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetSupplierRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `supplierId` | *string* | :heavy_check_mark: | Unique identifier for a supplier. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getsyncbyidrequest.md b/sync-for-expenses/docs/sdk/models/operations/getsyncbyidrequest.md index 2af028b0d..2181642c5 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getsyncbyidrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getsyncbyidrequest.md @@ -1,19 +1,19 @@ -# GetSyncByIdRequest - -## Example Usage - -```typescript -import { GetSyncByIdRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetSyncByIdRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# GetSyncByIdRequest + +## Example Usage + +```typescript +import { GetSyncByIdRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetSyncByIdRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/getsynctransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/getsynctransactionrequest.md index 8a9bea2af..a0480f852 100644 --- a/sync-for-expenses/docs/sdk/models/operations/getsynctransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/getsynctransactionrequest.md @@ -1,21 +1,21 @@ -# GetSyncTransactionRequest - -## Example Usage - -```typescript -import { GetSyncTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: GetSyncTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | +# GetSyncTransactionRequest + +## Example Usage + +```typescript +import { GetSyncTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: GetSyncTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | ------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | | `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listcompaniesrequest.md b/sync-for-expenses/docs/sdk/models/operations/listcompaniesrequest.md index 75a1acdf8..61bdfbed5 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listcompaniesrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listcompaniesrequest.md @@ -1,23 +1,23 @@ -# ListCompaniesRequest - -## Example Usage - -```typescript -import { ListCompaniesRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListCompaniesRequest = { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | -| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | +# ListCompaniesRequest + +## Example Usage + +```typescript +import { ListCompaniesRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListCompaniesRequest = { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +| `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | | `tags` | *string* | :heavy_minus_sign: | Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). | region=uk && team=invoice-finance | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listconnectionsrequest.md b/sync-for-expenses/docs/sdk/models/operations/listconnectionsrequest.md index 34da692d5..da3106f47 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listconnectionsrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listconnectionsrequest.md @@ -1,23 +1,23 @@ -# ListConnectionsRequest - -## Example Usage - -```typescript -import { ListConnectionsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListConnectionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListConnectionsRequest + +## Example Usage + +```typescript +import { ListConnectionsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListConnectionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listcustomersrequest.md b/sync-for-expenses/docs/sdk/models/operations/listcustomersrequest.md index f803f4ef7..f23d24151 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listcustomersrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listcustomersrequest.md @@ -1,23 +1,23 @@ -# ListCustomersRequest - -## Example Usage - -```typescript -import { ListCustomersRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListCustomersRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListCustomersRequest + +## Example Usage + +```typescript +import { ListCustomersRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListCustomersRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listpulloperationsrequest.md b/sync-for-expenses/docs/sdk/models/operations/listpulloperationsrequest.md index b94d5fe2f..64fe00558 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listpulloperationsrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listpulloperationsrequest.md @@ -1,23 +1,23 @@ -# ListPullOperationsRequest - -## Example Usage - -```typescript -import { ListPullOperationsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListPullOperationsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListPullOperationsRequest + +## Example Usage + +```typescript +import { ListPullOperationsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListPullOperationsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listpushoperationsrequest.md b/sync-for-expenses/docs/sdk/models/operations/listpushoperationsrequest.md index fc45f4aac..0e28a5808 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listpushoperationsrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listpushoperationsrequest.md @@ -1,23 +1,23 @@ -# ListPushOperationsRequest - -## Example Usage - -```typescript -import { ListPushOperationsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListPushOperationsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListPushOperationsRequest + +## Example Usage + +```typescript +import { ListPushOperationsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListPushOperationsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listsuppliersrequest.md b/sync-for-expenses/docs/sdk/models/operations/listsuppliersrequest.md index 77f29b496..830be6760 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listsuppliersrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listsuppliersrequest.md @@ -1,23 +1,23 @@ -# ListSuppliersRequest - -## Example Usage - -```typescript -import { ListSuppliersRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListSuppliersRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | -| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | +# ListSuppliersRequest + +## Example Usage + +```typescript +import { ListSuppliersRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListSuppliersRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +| `pageSize` | *number* | :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). | id=e3334455-1aed-4e71-ab43-6bccf12092ee | | `orderBy` | *string* | :heavy_minus_sign: | Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). | -modifiedDate | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listsyncsrequest.md b/sync-for-expenses/docs/sdk/models/operations/listsyncsrequest.md index e7795c50a..10c4aa05e 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listsyncsrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listsyncsrequest.md @@ -1,17 +1,17 @@ -# ListSyncsRequest - -## Example Usage - -```typescript -import { ListSyncsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListSyncsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# ListSyncsRequest + +## Example Usage + +```typescript +import { ListSyncsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListSyncsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/listsynctransactionsrequest.md b/sync-for-expenses/docs/sdk/models/operations/listsynctransactionsrequest.md index 68662c906..9b705d5fa 100644 --- a/sync-for-expenses/docs/sdk/models/operations/listsynctransactionsrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/listsynctransactionsrequest.md @@ -1,21 +1,21 @@ -# ListSyncTransactionsRequest - -## Example Usage - -```typescript -import { ListSyncTransactionsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ListSyncTransactionsRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | -| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | +# ListSyncTransactionsRequest + +## Example Usage + +```typescript +import { ListSyncTransactionsRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ListSyncTransactionsRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | +| `page` | *number* | :heavy_minus_sign: | Page number. [Read more](https://docs.codat.io/using-the-api/paging). | 1 | | `pageSize` | *number* | :heavy_minus_sign: | Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). | 100 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/refreshalldatatypesrequest.md b/sync-for-expenses/docs/sdk/models/operations/refreshalldatatypesrequest.md index b89b2938c..31d2f3559 100644 --- a/sync-for-expenses/docs/sdk/models/operations/refreshalldatatypesrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/refreshalldatatypesrequest.md @@ -1,17 +1,17 @@ -# RefreshAllDataTypesRequest - -## Example Usage - -```typescript -import { RefreshAllDataTypesRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: RefreshAllDataTypesRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# RefreshAllDataTypesRequest + +## Example Usage + +```typescript +import { RefreshAllDataTypesRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: RefreshAllDataTypesRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/refreshdatatyperequest.md b/sync-for-expenses/docs/sdk/models/operations/refreshdatatyperequest.md index 13c8bf6a4..e45845aa1 100644 --- a/sync-for-expenses/docs/sdk/models/operations/refreshdatatyperequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/refreshdatatyperequest.md @@ -1,20 +1,20 @@ -# RefreshDataTypeRequest - -## Example Usage - -```typescript -import { RefreshDataTypeRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: RefreshDataTypeRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | +# RefreshDataTypeRequest + +## Example Usage + +```typescript +import { RefreshDataTypeRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: RefreshDataTypeRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + dataType: "invoices", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------ | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `dataType` | [shared.DataType](../../../sdk/models/shared/datatype.md) | :heavy_check_mark: | The key of a Codat data type | invoices | | `connectionId` | *string* | :heavy_minus_sign: | Optionally, provide a data connection id to only queue pull operations on that connection. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/replacecompanyrequest.md b/sync-for-expenses/docs/sdk/models/operations/replacecompanyrequest.md index 39a5f1615..39ccb29f7 100644 --- a/sync-for-expenses/docs/sdk/models/operations/replacecompanyrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/replacecompanyrequest.md @@ -1,18 +1,18 @@ -# ReplaceCompanyRequest - -## Example Usage - -```typescript -import { ReplaceCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: ReplaceCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# ReplaceCompanyRequest + +## Example Usage + +```typescript +import { ReplaceCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: ReplaceCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyRequestBody` | [shared.CompanyRequestBody](../../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/setcompanyconfigurationrequest.md b/sync-for-expenses/docs/sdk/models/operations/setcompanyconfigurationrequest.md index 08215ca95..3b3fdd403 100644 --- a/sync-for-expenses/docs/sdk/models/operations/setcompanyconfigurationrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/setcompanyconfigurationrequest.md @@ -1,18 +1,18 @@ -# SetCompanyConfigurationRequest - -## Example Usage - -```typescript -import { SetCompanyConfigurationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: SetCompanyConfigurationRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# SetCompanyConfigurationRequest + +## Example Usage + +```typescript +import { SetCompanyConfigurationRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: SetCompanyConfigurationRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyConfiguration` | [shared.CompanyConfiguration](../../../sdk/models/shared/companyconfiguration.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionrequest.md b/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionrequest.md index 13e769eb4..3db0f3846 100644 --- a/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionrequest.md @@ -1,20 +1,20 @@ -# UnlinkConnectionRequest - -## Example Usage - -```typescript -import { UnlinkConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UnlinkConnectionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", -}; -``` - -## 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 | +# UnlinkConnectionRequest + +## Example Usage + +```typescript +import { UnlinkConnectionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UnlinkConnectionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", +}; +``` + +## 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 | | `requestBody` | [operations.UnlinkConnectionUpdateConnection](../../../sdk/models/operations/unlinkconnectionupdateconnection.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionupdateconnection.md b/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionupdateconnection.md index 31e24da54..d6a20058f 100644 --- a/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionupdateconnection.md +++ b/sync-for-expenses/docs/sdk/models/operations/unlinkconnectionupdateconnection.md @@ -1,15 +1,15 @@ -# UnlinkConnectionUpdateConnection - -## Example Usage - -```typescript -import { UnlinkConnectionUpdateConnection } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UnlinkConnectionUpdateConnection = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_minus_sign: | The current authorization status of the data connection. | \ No newline at end of file +# UnlinkConnectionUpdateConnection + +## Example Usage + +```typescript +import { UnlinkConnectionUpdateConnection } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UnlinkConnectionUpdateConnection = ""; +``` + +## Values + +```typescript + +``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/updatecompanyrequest.md b/sync-for-expenses/docs/sdk/models/operations/updatecompanyrequest.md index f7f4e0ce7..d585d058b 100644 --- a/sync-for-expenses/docs/sdk/models/operations/updatecompanyrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/updatecompanyrequest.md @@ -1,18 +1,18 @@ -# UpdateCompanyRequest - -## Example Usage - -```typescript -import { UpdateCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UpdateCompanyRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +# UpdateCompanyRequest + +## Example Usage + +```typescript +import { UpdateCompanyRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UpdateCompanyRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | | `companyUpdateRequest` | [shared.CompanyUpdateRequest](../../../sdk/models/shared/companyupdaterequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/updatecustomerrequest.md b/sync-for-expenses/docs/sdk/models/operations/updatecustomerrequest.md index 44258e0e3..90111122b 100644 --- a/sync-for-expenses/docs/sdk/models/operations/updatecustomerrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/updatecustomerrequest.md @@ -1,25 +1,25 @@ -# UpdateCustomerRequest - -## Example Usage - -```typescript -import { UpdateCustomerRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UpdateCustomerRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## 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 | -| `customerId` | *string* | :heavy_check_mark: | Unique identifier for a customer. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `forceUpdate` | *boolean* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | -| `customer` | [shared.Customer](../../../sdk/models/shared/customer.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# UpdateCustomerRequest + +## Example Usage + +```typescript +import { UpdateCustomerRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UpdateCustomerRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## 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 | +| `customerId` | *string* | :heavy_check_mark: | Unique identifier for a customer. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `forceUpdate` | *boolean* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `customer` | [shared.Customer](../../../sdk/models/shared/customer.md) | :heavy_minus_sign: | ## Overview

A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers).

Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice).
| | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/updateexpensetransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/updateexpensetransactionrequest.md index 1cd159b17..97ed1368d 100644 --- a/sync-for-expenses/docs/sdk/models/operations/updateexpensetransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/updateexpensetransactionrequest.md @@ -1,20 +1,20 @@ -# UpdateExpenseTransactionRequest - -## Example Usage - -```typescript -import { UpdateExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UpdateExpenseTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | +# UpdateExpenseTransactionRequest + +## Example Usage + +```typescript +import { UpdateExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UpdateExpenseTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | | `updateExpenseRequest` | [shared.UpdateExpenseRequest](../../../sdk/models/shared/updateexpenserequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/updatereimbursableexpensetransactionrequest.md b/sync-for-expenses/docs/sdk/models/operations/updatereimbursableexpensetransactionrequest.md index 46b059d4e..938dcd689 100644 --- a/sync-for-expenses/docs/sdk/models/operations/updatereimbursableexpensetransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/updatereimbursableexpensetransactionrequest.md @@ -1,20 +1,20 @@ -# UpdateReimbursableExpenseTransactionRequest - -## Example Usage - -```typescript -import { UpdateReimbursableExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UpdateReimbursableExpenseTransactionRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | -| `updateReimbursableExpenseTransactionRequest` | [shared.UpdateReimbursableExpenseTransactionRequest](../../../sdk/models/shared/updatereimbursableexpensetransactionrequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# UpdateReimbursableExpenseTransactionRequest + +## Example Usage + +```typescript +import { UpdateReimbursableExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UpdateReimbursableExpenseTransactionRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | +| `updateReimbursableExpenseTransactionRequest` | *shared.UpdateReimbursableExpenseTransactionRequest* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/updatesupplierrequest.md b/sync-for-expenses/docs/sdk/models/operations/updatesupplierrequest.md index e9f5b9548..e84221d59 100644 --- a/sync-for-expenses/docs/sdk/models/operations/updatesupplierrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/updatesupplierrequest.md @@ -1,25 +1,25 @@ -# UpdateSupplierRequest - -## Example Usage - -```typescript -import { UpdateSupplierRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -let value: UpdateSupplierRequest = { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", -}; -``` - -## 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 | -| `supplierId` | *string* | :heavy_check_mark: | Unique identifier for a supplier. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | -| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | -| `forceUpdate` | *boolean* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | -| `supplier` | [shared.Supplier](../../../sdk/models/shared/supplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | \ No newline at end of file +# UpdateSupplierRequest + +## Example Usage + +```typescript +import { UpdateSupplierRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UpdateSupplierRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", +}; +``` + +## 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 | +| `supplierId` | *string* | :heavy_check_mark: | Unique identifier for a supplier. | **Example 1:** 13d946f0-c5d5-42bc-b092-97ece17923ab
**Example 2:** 9wg4lep4ush5cxs79pl8sozmsndbaukll3ind4g7buqbm1h2
**Example 3:** 7110701885
**Example 4:** EILBDVJVNUAGVKRQ | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Time limit for the push operation to complete before it is timed out. | | +| `allowSyncOnPushComplete` | *boolean* | :heavy_minus_sign: | Allow a sync upon push completion. | | +| `forceUpdate` | *boolean* | :heavy_minus_sign: | When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. | | +| `supplier` | [shared.Supplier](../../../sdk/models/shared/supplier.md) | :heavy_minus_sign: | ## Overview

From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). | {
"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"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/operations/uploadexpenseattachmentrequest.md b/sync-for-expenses/docs/sdk/models/operations/uploadexpenseattachmentrequest.md index e208b8b73..2d44e3e98 100644 --- a/sync-for-expenses/docs/sdk/models/operations/uploadexpenseattachmentrequest.md +++ b/sync-for-expenses/docs/sdk/models/operations/uploadexpenseattachmentrequest.md @@ -1,18 +1,22 @@ -# UploadExpenseAttachmentRequest - -## Example Usage - -```typescript -import { UploadExpenseAttachmentRequest } from "@codat/sync-for-expenses/sdk/models/operations"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | -| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | +# UploadExpenseAttachmentRequest + +## Example Usage + +```typescript +import { UploadExpenseAttachmentRequest } from "@codat/sync-for-expenses/sdk/models/operations"; + +let value: UploadExpenseAttachmentRequest = { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for a company. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `syncId` | *string* | :heavy_check_mark: | Unique identifier for a sync. | 6fb40d5e-b13e-11ed-afa1-0242ac120002 | +| `transactionId` | *string* | :heavy_check_mark: | The unique identifier for your SMB's transaction. | 336694d8-2dca-4cb5-a28d-3ccb83e55eee | | `attachmentUpload` | [shared.AttachmentUpload](../../../sdk/models/shared/attachmentupload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountingaccount.md b/sync-for-expenses/docs/sdk/models/shared/accountingaccount.md index 4e964b870..a0fb49284 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountingaccount.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountingaccount.md @@ -1,74 +1,30 @@ -# ~~AccountingAccount~~ - -> **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. - -## Overview - -Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. - -The categories for an account include: -* Asset -* Expense -* Income -* Liability -* Equity. - -The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. - -At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. - -To determine the list of allowed categories for a specific integration, you can: -- Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). -- Refer to the integration's own documentation. - -> **Accounts with no category** -> -> If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. -> -> This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { AccountingAccount } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: AccountingAccount = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - id: "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", - nominalCode: "610", - name: "Accounts Receivable", - description: - "Invoices the business has issued but has not yet collected payment on.", - fullyQualifiedCategory: "Asset.Current", - fullyQualifiedName: "Cash On Hand", - currency: "GBP", - currentBalance: new Decimal("0"), - type: "Asset", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company. | 1b6266d1-1e44-46c5-8eb5-a8f98e03124e | -| `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 | -| `name` | *string* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | -| `description` | *string* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | -| `fullyQualifiedCategory` | *string* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | -| `fullyQualifiedName` | *string* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | **Example 1:** Cash On Hand
**Example 2:** Fixed Asset | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `currentBalance` | *Decimal* | :heavy_minus_sign: | Current balance in the account. | 0 | -| `type` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | -| `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `isBankAccount` | *boolean* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | -| `validDatatypeLinks` | [shared.CreateAccountResponseValidDataTypeLinks](../../../sdk/models/shared/createaccountresponsevaliddatatypelinks.md)[] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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. | | -| `metadata` | [shared.CreateAccountResponseMetadata](../../../sdk/models/shared/createaccountresponsemetadata.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# AccountingAccount + +## Example Usage + +```typescript +import { AccountingAccount } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountingAccount = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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. | +| `name` | *string* | :heavy_minus_sign: | Name of the account. | +| `description` | *string* | :heavy_minus_sign: | Description for the account. | +| `fullyQualifiedCategory` | *string* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | +| `fullyQualifiedName` | *string* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | +| `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. | +| `currentBalance` | *Decimal | number* | :heavy_minus_sign: | Current balance in the account. | +| `type` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_minus_sign: | N/A | +| `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | N/A | +| `isBankAccount` | *boolean* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | +| `validDatatypeLinks` | *CreateAccountResponseValidDataTypeLinks*[] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company. | +| `metadata` | *CreateAccountResponseMetadata* | :heavy_minus_sign: | N/A | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountingaddress.md b/sync-for-expenses/docs/sdk/models/shared/accountingaddress.md index dcd6f23b7..d434acd0f 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountingaddress.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountingaddress.md @@ -1,23 +1,23 @@ -# AccountingAddress - -## Example Usage - -```typescript -import { AccountingAddress } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountingAddress = { - type: "Unknown", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `type` | [shared.AccountingAddressType](../../../sdk/models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | -| `line1` | *string* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *string* | :heavy_minus_sign: | Line 2 of the customer address. | -| `city` | *string* | :heavy_minus_sign: | City of the customer address. | -| `region` | *string* | :heavy_minus_sign: | Region of the customer address. | -| `country` | *string* | :heavy_minus_sign: | Country of the customer address. | +# AccountingAddress + +## Example Usage + +```typescript +import { AccountingAddress } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountingAddress = { + type: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `type` | [shared.AccountingAddressType](../../../sdk/models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | +| `line1` | *string* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *string* | :heavy_minus_sign: | Line 2 of the customer address. | +| `city` | *string* | :heavy_minus_sign: | City of the customer address. | +| `region` | *string* | :heavy_minus_sign: | Region of the customer address. | +| `country` | *string* | :heavy_minus_sign: | Country of the customer address. | | `postalCode` | *string* | :heavy_minus_sign: | Postal code or zip code. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountingaddresstype.md b/sync-for-expenses/docs/sdk/models/shared/accountingaddresstype.md index 329f374d8..10fcca4df 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountingaddresstype.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountingaddresstype.md @@ -1,17 +1,17 @@ -# AccountingAddressType - -The type of the address - -## Example Usage - -```typescript -import { AccountingAddressType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountingAddressType = "Unknown"; -``` - -## Values - -```typescript -"Unknown" | "Billing" | "Delivery" +# AccountingAddressType + +The type of the address + +## Example Usage + +```typescript +import { AccountingAddressType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountingAddressType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Billing" | "Delivery" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountingbankaccount.md b/sync-for-expenses/docs/sdk/models/shared/accountingbankaccount.md index 060a3e9cf..7d3bcb25d 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountingbankaccount.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountingbankaccount.md @@ -1,53 +1,31 @@ -# ~~AccountingBankAccount~~ - -> **Accessing Bank Accounts through Banking API** -> -> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. -> -> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. - -## Overview - -A list of bank accounts associated with a company and a specific data connection. - -Bank accounts data includes: -* The name and ID of the account in the accounting software. -* The currency and balance of the account. -* The sort code and account number. - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { AccountingBankAccount } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountingBankAccount = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | -| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.CreateBankAccountResponseBankAccountType](../../../sdk/models/shared/createbankaccountresponsebankaccounttype.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. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `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. | | -| `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. | | -| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | Balance of the bank account. | | -| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | -| `availableBalance` | *Decimal* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | -| `overdraftLimit` | *Decimal* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | -| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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 +# AccountingBankAccount + +## Example Usage + +```typescript +import { AccountingBankAccount } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountingBankAccount = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | +| `accountType` | [shared.CreateBankAccountResponseBankAccountType](../../../sdk/models/shared/createbankaccountresponsebankaccounttype.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. | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | +| `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. | +| `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. | +| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | +| `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. | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Balance of the bank account. | +| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | +| `availableBalance` | *Decimal | number* | :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. | +| `overdraftLimit` | *Decimal | number* | :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`. | +| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | N/A | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountingcustomer.md b/sync-for-expenses/docs/sdk/models/shared/accountingcustomer.md index 65cf569e8..04353becc 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountingcustomer.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountingcustomer.md @@ -1,50 +1,29 @@ -# ~~AccountingCustomer~~ - -## Overview - -A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - -Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { AccountingCustomer } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountingCustomer = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Archived", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | -| `customerName` | *string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `phone` | *string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | -| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `contacts` | [shared.Contact](../../../sdk/models/shared/contact.md)[] | :heavy_minus_sign: | An array of Contacts. | | -| `registrationNumber` | *string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | | -| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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 +# AccountingCustomer + +## Example Usage + +```typescript +import { AccountingCustomer } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountingCustomer = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | +| `customerName` | *string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the identified customer. | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address the customer can be contacted by. | +| `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. | +| `phone` | *string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | +| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | +| `contacts` | [shared.Contact](../../../sdk/models/shared/contact.md)[] | :heavy_minus_sign: | An array of Contacts. | +| `registrationNumber` | *string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | +| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | +| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Current state of the customer. | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountingsupplier.md b/sync-for-expenses/docs/sdk/models/shared/accountingsupplier.md index a4a8675ee..8b2cfbce6 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountingsupplier.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountingsupplier.md @@ -1,71 +1,28 @@ -# ~~AccountingSupplier~~ - -## Overview - -From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { AccountingSupplier } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountingSupplier = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | -| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | -| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `registrationNumber` | *string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Supplier's company tax number. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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 +# AccountingSupplier + +## Example Usage + +```typescript +import { AccountingSupplier } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountingSupplier = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | +| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | +| `registrationNumber` | *string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | +| `taxNumber` | *string* | :heavy_minus_sign: | Supplier's company tax number. | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | N/A | +| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountmappinginfo.md b/sync-for-expenses/docs/sdk/models/shared/accountmappinginfo.md index a3ba74ac7..060ce8f10 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountmappinginfo.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountmappinginfo.md @@ -1,36 +1,30 @@ -# AccountMappingInfo - -## Example Usage - -```typescript -import { AccountMappingInfo } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountMappingInfo = { - id: "127f3b99-8dc2-4b7e-854c-91ef9bd2757b", - nominalCode: "300", - name: "Purchases", - currency: "GBP", - accountType: "Expense", - fullyQualifiedCategory: "Expense.DirectCosts", - validTransactionTypes: [ - "Payment", - ], - validFor: [ - "expense-transactions.Payment", - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of account. | 127f3b99-8dc2-4b7e-854c-91ef9bd2757b | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account in the accounting software. | 300 | -| `name` | *string* | :heavy_minus_sign: | Name of the account as it appears in the company's accounting software. | Purchases | -| `currency` | *string* | :heavy_minus_sign: | Currency of the account. | GBP | -| `accountType` | [shared.AccountMappingInfoAccountType](../../../sdk/models/shared/accountmappinginfoaccounttype.md) | :heavy_minus_sign: | Type of the account. | Expense | -| `fullyQualifiedCategory` | *string* | :heavy_minus_sign: | Full account type and category of the account | Expense.DirectCosts | -| `isBankAccount` | *boolean* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | -| `validTransactionTypes` | [shared.ValidTransactionTypes](../../../sdk/models/shared/validtransactiontypes.md)[] | :heavy_minus_sign: | Supported transaction types for the account. | | +# AccountMappingInfo + +## Example Usage + +```typescript +import { AccountMappingInfo } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountMappingInfo = { + id: "127f3b99-8dc2-4b7e-854c-91ef9bd2757b", + nominalCode: "300", + name: "Purchases", + currency: "GBP", + accountType: "Expense", + fullyQualifiedCategory: "Expense.DirectCosts", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of account. | 127f3b99-8dc2-4b7e-854c-91ef9bd2757b | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account in the accounting software. | 300 | +| `name` | *string* | :heavy_minus_sign: | Name of the account as it appears in the company's accounting software. | Purchases | +| `currency` | *string* | :heavy_minus_sign: | Currency of the account. | GBP | +| `accountType` | [shared.AccountMappingInfoAccountType](../../../sdk/models/shared/accountmappinginfoaccounttype.md) | :heavy_minus_sign: | Type of the account. | Expense | +| `fullyQualifiedCategory` | *string* | :heavy_minus_sign: | Full account type and category of the account | Expense.DirectCosts | +| `isBankAccount` | *boolean* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `validTransactionTypes` | [shared.ValidTransactionTypes](../../../sdk/models/shared/validtransactiontypes.md)[] | :heavy_minus_sign: | Supported transaction types for the account. | | | `validFor` | [shared.ValidFor](../../../sdk/models/shared/validfor.md)[] | :heavy_minus_sign: | Supported endpoints for the account. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountmappinginfoaccounttype.md b/sync-for-expenses/docs/sdk/models/shared/accountmappinginfoaccounttype.md index 3f6674836..78edae507 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountmappinginfoaccounttype.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountmappinginfoaccounttype.md @@ -1,17 +1,15 @@ -# AccountMappingInfoAccountType - -Type of the account. - -## Example Usage - -```typescript -import { AccountMappingInfoAccountType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountMappingInfoAccountType = "Expense"; -``` - -## Values - -```typescript -"Asset" | "Liability" | "Income" | "Expense" | "Equity" +# AccountMappingInfoAccountType + +## Example Usage + +```typescript +import { AccountMappingInfoAccountType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountMappingInfoAccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountprototype.md b/sync-for-expenses/docs/sdk/models/shared/accountprototype.md index 0e92b9eca..6e9ea2ffc 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountprototype.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountprototype.md @@ -1,38 +1,36 @@ -# AccountPrototype - -## Example Usage - -```typescript -import { AccountPrototype } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: AccountPrototype = { - nominalCode: "610", - name: "Accounts Receivable", - description: - "Invoices the business has issued but has not yet collected payment on.", - fullyQualifiedCategory: "Asset.Current", - fullyQualifiedName: "Cash On Hand", - currency: "GBP", - currentBalance: new Decimal("0"), - type: "Asset", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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 | -| `name` | *string* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | -| `description` | *string* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | -| `fullyQualifiedCategory` | *string* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | -| `fullyQualifiedName` | *string* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | **Example 1:** Cash On Hand
**Example 2:** Fixed Asset | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `currentBalance` | *Decimal* | :heavy_minus_sign: | Current balance in the account. | 0 | -| `type` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | -| `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | -| `isBankAccount` | *boolean* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | -| `validDatatypeLinks` | [shared.ValidDataTypeLinks](../../../sdk/models/shared/validdatatypelinks.md)[] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). | | +# AccountPrototype + +## Example Usage + +```typescript +import { AccountPrototype } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountPrototype = { + nominalCode: "610", + name: "Accounts Receivable", + description: "Invoices the business has issued but has not yet collected payment on.", + fullyQualifiedCategory: "Asset.Current", + fullyQualifiedName: "Cash On Hand", + currency: "GBP", + currentBalance: 0, + type: "Asset", + status: "Active", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `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 | +| `name` | *string* | :heavy_minus_sign: | Name of the account. | Accounts Receivable | +| `description` | *string* | :heavy_minus_sign: | Description for the account. | Invoices the business has issued but has not yet collected payment on. | +| `fullyQualifiedCategory` | *string* | :heavy_minus_sign: | Full category of the account.

For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. | Asset.Current | +| `fullyQualifiedName` | *string* | :heavy_minus_sign: | Full name of the account, for example:
- `Cash On Hand`
- `Rents Held In Trust`
- `Fixed Asset` | **Example 1:** Cash On Hand
**Example 2:** Fixed Asset | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `currentBalance` | *Decimal | number* | :heavy_minus_sign: | Current balance in the account. | 0 | +| `type` | [shared.AccountType](../../../sdk/models/shared/accounttype.md) | :heavy_minus_sign: | Type of account | Asset | +| `status` | [shared.AccountStatus](../../../sdk/models/shared/accountstatus.md) | :heavy_minus_sign: | Status of the account | Active | +| `isBankAccount` | *boolean* | :heavy_minus_sign: | Confirms whether the account is a bank account or not. | | +| `validDatatypeLinks` | [shared.ValidDataTypeLinks](../../../sdk/models/shared/validdatatypelinks.md)[] | :heavy_minus_sign: | The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). | | | `supplementalData` | [shared.SupplementalData](../../../sdk/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/sync-for-expenses/docs/sdk/models/shared/accountreference.md b/sync-for-expenses/docs/sdk/models/shared/accountreference.md index c23a324e2..fba3bdf19 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountreference.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountreference.md @@ -1,19 +1,19 @@ -# AccountReference - -Reference of the account you are transferring money from. - -## Example Usage - -```typescript -import { AccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountReference = { - id: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +# AccountReference + +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. + +## Example Usage + +```typescript +import { AccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountReference = { + id: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | | `id` | *string* | :heavy_check_mark: | 'id' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accountstatus.md b/sync-for-expenses/docs/sdk/models/shared/accountstatus.md index dcf16a7ae..6d904211e 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accountstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/accountstatus.md @@ -1,17 +1,17 @@ -# AccountStatus - -Status of the account - -## Example Usage - -```typescript -import { AccountStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountStatus = "Active"; -``` - -## Values - -```typescript -"Unknown" | "Active" | "Archived" | "Pending" +# AccountStatus + +Status of the account + +## Example Usage + +```typescript +import { AccountStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Active" | "Archived" | "Pending" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/accounttype.md b/sync-for-expenses/docs/sdk/models/shared/accounttype.md index 7c160556e..72d84f518 100644 --- a/sync-for-expenses/docs/sdk/models/shared/accounttype.md +++ b/sync-for-expenses/docs/sdk/models/shared/accounttype.md @@ -1,17 +1,17 @@ -# AccountType - -Type of account - -## Example Usage - -```typescript -import { AccountType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AccountType = "Asset"; -``` - -## Values - -```typescript -"Unknown" | "Asset" | "Expense" | "Income" | "Liability" | "Equity" +# AccountType + +Type of account + +## Example Usage + +```typescript +import { AccountType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AccountType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Asset" | "Expense" | "Income" | "Liability" | "Equity" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionline.md b/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionline.md index e7b048d63..ba56998e8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionline.md +++ b/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionline.md @@ -1,35 +1,25 @@ -# AdjustmentTransactionLine - -## Example Usage - -```typescript -import { AdjustmentTransactionLine } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: AdjustmentTransactionLine = { - amount: new Decimal("50"), - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - description: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `amount` | *Decimal* | :heavy_check_mark: | Amount of the line. A positive line represents a debit; a negative line represents a credit. | 50 | -| `accountRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_check_mark: | N/A | | -| `description` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | -| `trackingRefs` | [shared.TrackingRefAdjustmentTransaction](../../../sdk/models/shared/trackingrefadjustmenttransaction.md)[] | :heavy_minus_sign: | N/A | | +# AdjustmentTransactionLine + +## Example Usage + +```typescript +import { AdjustmentTransactionLine } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AdjustmentTransactionLine = { + amount: 50, + accountRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + description: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `amount` | *Decimal | number* | :heavy_check_mark: | Amount of the line. A positive line represents a debit; a negative line represents a credit. | 50 | +| `accountRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_check_mark: | N/A | | +| `description` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +| `trackingRefs` | [shared.TrackingRefAdjustmentTransaction](../../../sdk/models/shared/trackingrefadjustmenttransaction.md)[] | :heavy_minus_sign: | N/A | | | `invoiceTo` | [shared.InvoiceTo](../../../sdk/models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionrequest.md b/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionrequest.md index 9a51d7d46..9f6edd6ac 100644 --- a/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionrequest.md @@ -1,25 +1,43 @@ -# AdjustmentTransactionRequest - -## Example Usage - -```typescript -import { AdjustmentTransactionRequest } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AdjustmentTransactionRequest = { - id: "f7aa2569-6e6f-42cc-9845-b7ae32ba9169", - date: "2022-10-23T00:00:00Z", - currency: "Rwanda Franc", - lines: [], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Your unique identifier for the transaction. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | -| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the adjustment transaction. | | -| `lines` | [shared.AdjustmentTransactionLine](../../../sdk/models/shared/adjustmenttransactionline.md)[] | :heavy_check_mark: | Array of transaction lines. | | \ No newline at end of file +# AdjustmentTransactionRequest + +## Example Usage + +```typescript +import { AdjustmentTransactionRequest } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AdjustmentTransactionRequest = { + id: "string", + date: "string", + currency: "string", + lines: [ + { + amount: 50, + accountRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + description: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + trackingRefs: [ + { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "80000002-1674552702", + type: "customer", + }, + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Your unique identifier for the transaction. | +| `date` | *string* | :heavy_check_mark: | Date of the transaction. | +| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | +| `currencyRate` | *Decimal | number* | :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. \| | +| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the adjustment transaction. | +| `lines` | [shared.AdjustmentTransactionLine](../../../sdk/models/shared/adjustmenttransactionline.md)[] | :heavy_check_mark: | Array of transaction lines. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionresponse.md b/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionresponse.md index cbb13947e..599fdb02d 100644 --- a/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/adjustmenttransactionresponse.md @@ -1,17 +1,17 @@ -# AdjustmentTransactionResponse - -## Example Usage - -```typescript -import { AdjustmentTransactionResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: AdjustmentTransactionResponse = { - syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# AdjustmentTransactionResponse + +## Example Usage + +```typescript +import { AdjustmentTransactionResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AdjustmentTransactionResponse = { + syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `syncId` | *string* | :heavy_minus_sign: | Unique id of sync created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/apaccountref.md b/sync-for-expenses/docs/sdk/models/shared/apaccountref.md index dc0b26bd1..db2f60449 100644 --- a/sync-for-expenses/docs/sdk/models/shared/apaccountref.md +++ b/sync-for-expenses/docs/sdk/models/shared/apaccountref.md @@ -1,17 +1,17 @@ -# ApAccountRef - -## Example Usage - -```typescript -import { ApAccountRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ApAccountRef = { - id: "8000004C-1724173136", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# ApAccountRef + +## Example Usage + +```typescript +import { ApAccountRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ApAccountRef = { + id: "8000004C-1724173136", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. | 8000004C-1724173136 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/attachment.md b/sync-for-expenses/docs/sdk/models/shared/attachment.md index b4a8ddd60..04c865dc2 100644 --- a/sync-for-expenses/docs/sdk/models/shared/attachment.md +++ b/sync-for-expenses/docs/sdk/models/shared/attachment.md @@ -1,17 +1,17 @@ -# Attachment - -## Example Usage - -```typescript -import { Attachment } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Attachment = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | -| `companyId` | *string* | :heavy_minus_sign: | Unique ID of company in Codat | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of attachment | +# Attachment + +## Example Usage + +```typescript +import { Attachment } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Attachment = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------- | -------------------------------- | -------------------------------- | -------------------------------- | +| `companyId` | *string* | :heavy_minus_sign: | Unique ID of company in Codat | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of attachment | | `transactionId` | *string* | :heavy_minus_sign: | Unique identifier of transaction | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/attachmentupload.md b/sync-for-expenses/docs/sdk/models/shared/attachmentupload.md index 835874929..944b16742 100644 --- a/sync-for-expenses/docs/sdk/models/shared/attachmentupload.md +++ b/sync-for-expenses/docs/sdk/models/shared/attachmentupload.md @@ -1,15 +1,17 @@ -# AttachmentUpload - -## Example Usage - -```typescript -import { AttachmentUpload } from "@codat/sync-for-expenses/sdk/models/shared"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `file` | [File](https://developer.mozilla.org/en-US/docs/Web/API/File) \| [Blob](https://developer.mozilla.org/en-US/docs/Web/API/Blob) \| [shared.CodatFile](../../../sdk/models/shared/codatfile.md) | :heavy_check_mark: | The file to be uploaded as an attachment. | \ No newline at end of file +# AttachmentUpload + +## Example Usage + +```typescript +import { AttachmentUpload } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: AttachmentUpload = { + file: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | ----------------------------------------- | +| `file` | *CodatFile | Blob* | :heavy_check_mark: | The file to be uploaded as an attachment. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/bankaccount.md b/sync-for-expenses/docs/sdk/models/shared/bankaccount.md index 271d7b9f6..1c47feb2b 100644 --- a/sync-for-expenses/docs/sdk/models/shared/bankaccount.md +++ b/sync-for-expenses/docs/sdk/models/shared/bankaccount.md @@ -1,51 +1,51 @@ -# BankAccount - -> **Accessing Bank Accounts through Banking API** -> -> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. -> -> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. - -## Overview - -A list of bank accounts associated with a company and a specific data connection. - -Bank accounts data includes: -* The name and ID of the account in the accounting software. -* The currency and balance of the account. -* The sort code and account number. - -## Example Usage - -```typescript -import { BankAccount } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: BankAccount = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | -| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | -| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | -| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | -| `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. | | -| `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. | | -| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `balance` | *Decimal* | :heavy_minus_sign: | Balance of the bank account. | | -| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | -| `availableBalance` | *Decimal* | :heavy_minus_sign: | Total available balance of the bank account as reported by the underlying data source. This may take into account overdrafts or pending transactions for example. | | -| `overdraftLimit` | *Decimal* | :heavy_minus_sign: | Pre-arranged overdraft limit of the account.

The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. | | -| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +# BankAccount + +> **Accessing Bank Accounts through Banking API** +> +> This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. +> +> To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. + +## Overview + +A list of bank accounts associated with a company and a specific data connection. + +Bank accounts data includes: +* The name and ID of the account in the accounting software. +* The currency and balance of the account. +* The sort code and account number. + +## Example Usage + +```typescript +import { BankAccount } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: BankAccount = { + currency: "GBP", + status: "Active", + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `accountName` | *string* | :heavy_minus_sign: | Name of the bank account in the accounting software. | | +| `accountType` | [shared.BankAccountType](../../../sdk/models/shared/bankaccounttype.md) | :heavy_minus_sign: | The type of transactions and balances on the account.
For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities.
For Debit accounts, positive balances are assets, and positive transactions **increase** assets. | | +| `nominalCode` | *string* | :heavy_minus_sign: | Code used to identify each nominal account for a business. | | +| `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. | | +| `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. | | +| `iBan` | *string* | :heavy_minus_sign: | International bank account number of the account. Often used when making or receiving international payments. | | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `balance` | *Decimal | number* | :heavy_minus_sign: | Balance of the bank account. | | +| `institution` | *string* | :heavy_minus_sign: | The institution of the bank account. | | +| `availableBalance` | *Decimal | number* | :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. | | +| `overdraftLimit` | *Decimal | number* | :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`. | | +| `status` | [shared.BankAccountStatus](../../../sdk/models/shared/bankaccountstatus.md) | :heavy_minus_sign: | Status of the bank account. | Active | +| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `id` | *string* | :heavy_minus_sign: | Identifier for the account, unique for the company in the accounting software. | | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `supplementalData` | [shared.SupplementalData](../../../sdk/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/sync-for-expenses/docs/sdk/models/shared/bankaccountdetails.md b/sync-for-expenses/docs/sdk/models/shared/bankaccountdetails.md index ce07f9f39..d8a5102c8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/bankaccountdetails.md +++ b/sync-for-expenses/docs/sdk/models/shared/bankaccountdetails.md @@ -1,17 +1,17 @@ -# BankAccountDetails - -## Example Usage - -```typescript -import { BankAccountDetails } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: BankAccountDetails = { - id: "32", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | +# BankAccountDetails + +## Example Usage + +```typescript +import { BankAccountDetails } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: BankAccountDetails = { + id: "32", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | --------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | The id of the account from which purchases are made | 32 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/bankaccountreference.md b/sync-for-expenses/docs/sdk/models/shared/bankaccountreference.md index f816304a2..ad9b7a197 100644 --- a/sync-for-expenses/docs/sdk/models/shared/bankaccountreference.md +++ b/sync-for-expenses/docs/sdk/models/shared/bankaccountreference.md @@ -1,17 +1,17 @@ -# BankAccountReference - -## Example Usage - -```typescript -import { BankAccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: BankAccountReference = { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *string* | :heavy_minus_sign: | Identifier of the bank account. | 787dfb37-5707-4dc0-8a86-8d74e4cc78ea | \ No newline at end of file +# BankAccountReference + +Links to the Account transactions data type. + +## Example Usage + +```typescript +import { BankAccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: BankAccountReference = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Bank account 'id' for the account transaction. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/bankaccountstatus.md b/sync-for-expenses/docs/sdk/models/shared/bankaccountstatus.md index b3f48e419..8eacaf597 100644 --- a/sync-for-expenses/docs/sdk/models/shared/bankaccountstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/bankaccountstatus.md @@ -1,17 +1,17 @@ -# BankAccountStatus - -Status of the bank account. - -## Example Usage - -```typescript -import { BankAccountStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: BankAccountStatus = "Active"; -``` - -## Values - -```typescript -"Unknown" | "Active" | "Archived" | "Pending" +# BankAccountStatus + +Status of the bank account. + +## Example Usage + +```typescript +import { BankAccountStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: BankAccountStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Active" | "Archived" | "Pending" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/bankaccounttype.md b/sync-for-expenses/docs/sdk/models/shared/bankaccounttype.md index 06fd8ef77..84a04ebd8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/bankaccounttype.md +++ b/sync-for-expenses/docs/sdk/models/shared/bankaccounttype.md @@ -1,19 +1,19 @@ -# BankAccountType - -The type of transactions and balances on the account. -For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. -For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - -## Example Usage - -```typescript -import { BankAccountType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: BankAccountType = "Unknown"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" +# BankAccountType + +The type of transactions and balances on the account. +For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. +For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + +## Example Usage + +```typescript +import { BankAccountType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: BankAccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhook.md b/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhook.md index f7b31736e..e9a170ea9 100644 --- a/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhook.md +++ b/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhook.md @@ -1,25 +1,21 @@ -# ClientRateLimitWebhook - -## Example Usage - -```typescript -import { ClientRateLimitWebhook } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ClientRateLimitWebhook = { - id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", - eventType: "client.rateLimit.reset", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - expiryDate: "2022-10-23T00:00:00Z", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.ClientRateLimitWebhookPayload](../../../sdk/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# ClientRateLimitWebhook + +## Example Usage + +```typescript +import { ClientRateLimitWebhook } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ClientRateLimitWebhook = { + id: "743ec94a-8aa4-44bb-8bd4-e1855ee0e74b", + eventType: "client.rateLimit.reset", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | 743ec94a-8aa4-44bb-8bd4-e1855ee0e74b | +| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** client.rateLimit.reset
**Example 2:** client.rateLimit.reached | +| `generatedDate` | *string* | :heavy_minus_sign: | The date time in UTC the event was generated in Codat. | | +| `payload` | [shared.ClientRateLimitWebhookPayload](../../../sdk/models/shared/clientratelimitwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhookpayload.md b/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhookpayload.md index b2e4e808d..7b587ea72 100644 --- a/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhookpayload.md +++ b/sync-for-expenses/docs/sdk/models/shared/clientratelimitwebhookpayload.md @@ -1,19 +1,17 @@ -# ClientRateLimitWebhookPayload - -## Example Usage - -```typescript -import { ClientRateLimitWebhookPayload } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ClientRateLimitWebhookPayload = { - expiryDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | | -| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# ClientRateLimitWebhookPayload + +## Example Usage + +```typescript +import { ClientRateLimitWebhookPayload } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ClientRateLimitWebhookPayload = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +| `dailyQuota` | *number* | :heavy_minus_sign: | The number of available requests per day. | +| `quotaRemaining` | *number* | :heavy_minus_sign: | Total number of requests remaining for your client. | +| `expiryDate` | *string* | :heavy_minus_sign: | The date time in UTC when your daily quota is reset. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/codatfile.md b/sync-for-expenses/docs/sdk/models/shared/codatfile.md index 992373efb..c42173b34 100644 --- a/sync-for-expenses/docs/sdk/models/shared/codatfile.md +++ b/sync-for-expenses/docs/sdk/models/shared/codatfile.md @@ -1,16 +1,16 @@ -# CodatFile - -## Example Usage - -```typescript -import { CodatFile } from "@codat/sync-for-expenses/sdk/models/shared"; - -// No examples available for this model -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------- | ---------------------------- | ---------------------------- | ---------------------------- | -| `fileName` | *string* | :heavy_check_mark: | N/A | -| `content` | *ReadableStream* | :heavy_check_mark: | N/A | \ No newline at end of file +# CodatFile + +## Example Usage + +```typescript +import { CodatFile } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CodatFile = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | -------------------------------------------------------------- | +| `content` | *ReadableStream | Blob | ArrayBuffer | Uint8Array* | :heavy_check_mark: | N/A | +| `fileName` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companies.md b/sync-for-expenses/docs/sdk/models/shared/companies.md index 6c3aad5c0..eadb62b0f 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companies.md +++ b/sync-for-expenses/docs/sdk/models/shared/companies.md @@ -1,31 +1,23 @@ -# Companies - -## Example Usage - -```typescript -import { Companies } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Companies = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Companies + +## Example Usage + +```typescript +import { Companies } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Companies = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | --------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Company](../../../sdk/models/shared/company.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/company.md b/sync-for-expenses/docs/sdk/models/shared/company.md index cd71b8f87..1511729ac 100644 --- a/sync-for-expenses/docs/sdk/models/shared/company.md +++ b/sync-for-expenses/docs/sdk/models/shared/company.md @@ -1,63 +1,61 @@ -# Company - -In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. - -Typically each company is one of your customers. - -When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. - -## Example Usage - -```typescript -import { Company } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Company = { - 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", - products: [ - "spend-insights", - "lending", - ], - 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", - sourceType: "Banking", - 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", - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | -| `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. | -| `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 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `created` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | -| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | -| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | -| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | | -| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md)[] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | -| `dataConnections` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file +# Company + +In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + +Typically each company is one of your customers. + +When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + +## Example Usage + +```typescript +import { Company } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Company = { + 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", + products: [ + "spend-insights", + "lending", + ], + 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", + sourceType: "Banking", + 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", + }, + ], +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_check_mark: | The name of the company | Codat Ltd. | +| `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. | +| `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 | +| `lastSync` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | | +| `created` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | | +| `createdByUserName` | *string* | :heavy_minus_sign: | Name of user that created the company in Codat. | | +| `products` | *string*[] | :heavy_minus_sign: | An array of products that are currently enabled for the company. | | +| `tags` | Record | :heavy_minus_sign: | A collection of user-defined key-value pairs that store custom metadata against the company. | | +| `referenceParentCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | The parent entity or controlling organization of this company. Null if the company has no parent. | | +| `referenceSubsidiaryCompanies` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md)[] | :heavy_minus_sign: | A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. | | +| `dataConnections` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companyconfiguration.md b/sync-for-expenses/docs/sdk/models/shared/companyconfiguration.md index 0c3c170f7..2e8f632e6 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyconfiguration.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyconfiguration.md @@ -1,23 +1,27 @@ -# CompanyConfiguration - -## Example Usage - -```typescript -import { CompanyConfiguration } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyConfiguration = { - bankAccount: { - id: "32", - }, - supplier: {}, - customer: {}, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `bankAccount` | [shared.BankAccountDetails](../../../sdk/models/shared/bankaccountdetails.md) | :heavy_check_mark: | N/A | -| `supplier` | [shared.SupplierDetails](../../../sdk/models/shared/supplierdetails.md) | :heavy_check_mark: | N/A | +# CompanyConfiguration + +## Example Usage + +```typescript +import { CompanyConfiguration } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyConfiguration = { + bankAccount: { + id: "32", + }, + supplier: { + id: "string", + }, + customer: { + id: "string", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `bankAccount` | [shared.BankAccountDetails](../../../sdk/models/shared/bankaccountdetails.md) | :heavy_check_mark: | N/A | +| `supplier` | [shared.SupplierDetails](../../../sdk/models/shared/supplierdetails.md) | :heavy_check_mark: | N/A | | `customer` | [shared.CustomerDetails](../../../sdk/models/shared/customerdetails.md) | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companyinformation.md b/sync-for-expenses/docs/sdk/models/shared/companyinformation.md index ca591ec43..5e7950bfe 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyinformation.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyinformation.md @@ -1,80 +1,80 @@ -# CompanyInformation - -Company info provides standard details about a linked company such as their address, phone number, and company registration. - -> **Company information or companies?** -> -> Company information 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. - -## Example Usage - -```typescript -import { CompanyInformation } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyInformation = { - 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", - }, - { - 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", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyName` | *string* | :heavy_minus_sign: | Name of the linked company. | | -| `accountingPlatformRef` | *string* | :heavy_minus_sign: | Identifier or reference for the company in the accounting software. | | -| `companyLegalName` | *string* | :heavy_minus_sign: | Registered legal name of the linked company. | | -| `addresses` | [shared.AccountingAddress](../../../sdk/models/shared/accountingaddress.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `phoneNumbers` | [shared.Phone](../../../sdk/models/shared/phone.md)[] | :heavy_minus_sign: | An array of phone numbers. | | -| `webLinks` | [shared.Weblink](../../../sdk/models/shared/weblink.md)[] | :heavy_minus_sign: | An array of weblinks. | | -| `ledgerLockDate` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | | -| `financialYearStartDate` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `baseCurrency` | *string* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. Used by the currency rate. | | -| `sourceUrls` | Record | :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). | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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 +# CompanyInformation + +Company info provides standard details about a linked company such as their address, phone number, and company registration. + +> **Company information or companies?** +> +> Company information 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. + +## Example Usage + +```typescript +import { CompanyInformation } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyInformation = { + 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", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `companyName` | *string* | :heavy_minus_sign: | Name of the linked company. | +| `accountingPlatformRef` | *string* | :heavy_minus_sign: | Identifier or reference for the company in the accounting software. | +| `companyLegalName` | *string* | :heavy_minus_sign: | Registered legal name of the linked company. | +| `addresses` | [shared.AccountingAddress](../../../sdk/models/shared/accountingaddress.md)[] | :heavy_minus_sign: | An array of Addresses. | +| `phoneNumbers` | *Phone*[] | :heavy_minus_sign: | An array of phone numbers. | +| `webLinks` | [shared.Weblink](../../../sdk/models/shared/weblink.md)[] | :heavy_minus_sign: | An array of weblinks. | +| `ledgerLockDate` | *string* | :heavy_minus_sign: | If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. | +| `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. | +| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | +| `financialYearStartDate` | *string* | :heavy_minus_sign: | Start date of the financial year for the company. | +| `baseCurrency` | *string* | :heavy_minus_sign: | Currency set in the accounting software of the linked company. Used by the currency rate. | +| `sourceUrls` | Record | :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). | +| `createdDate` | *string* | :heavy_minus_sign: | Date the linked company was created in the accounting software. | +| `supplementalData` | [shared.SupplementalData](../../../sdk/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/sync-for-expenses/docs/sdk/models/shared/companyinformationphonenumberstype.md b/sync-for-expenses/docs/sdk/models/shared/companyinformationphonenumberstype.md index d3d67cf97..99c6f60e9 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyinformationphonenumberstype.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyinformationphonenumberstype.md @@ -1,17 +1,15 @@ -# CompanyInformationPhoneNumbersType - -The type of phone number - -## Example Usage - -```typescript -import { CompanyInformationPhoneNumbersType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyInformationPhoneNumbersType = "Unknown"; -``` - -## Values - -```typescript -"Primary" | "Landline" | "Mobile" | "Fax" | "Unknown" +# CompanyInformationPhoneNumbersType + +## Example Usage + +```typescript +import { CompanyInformationPhoneNumbersType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyInformationPhoneNumbersType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companyinformationtype.md b/sync-for-expenses/docs/sdk/models/shared/companyinformationtype.md index aff62fba0..c014c121a 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyinformationtype.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyinformationtype.md @@ -1,17 +1,15 @@ -# CompanyInformationType - -The type of the weblink. - -## Example Usage - -```typescript -import { CompanyInformationType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyInformationType = "Social"; -``` - -## Values - -```typescript -"Website" | "Social" | "Unknown" +# CompanyInformationType + +## Example Usage + +```typescript +import { CompanyInformationType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyInformationType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companyreference.md b/sync-for-expenses/docs/sdk/models/shared/companyreference.md index 75a856b24..c73c8ff0c 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyreference.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyreference.md @@ -1,23 +1,23 @@ -# CompanyReference - -## Example Usage - -```typescript -import { CompanyReference } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyReference = { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `name` | *string* | :heavy_minus_sign: | The name of the company | Codat Ltd. | -| `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. | -| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | +# CompanyReference + +## Example Usage + +```typescript +import { CompanyReference } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyReference = { + id: "8a210b68-6988-11ed-a1eb-0242ac120002", + name: "Codat Ltd.", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `name` | *string* | :heavy_minus_sign: | The name of the company | Codat Ltd. | +| `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. | +| `links` | [shared.CompanyReferenceLinks](../../../sdk/models/shared/companyreferencelinks.md) | :heavy_minus_sign: | A collection of links for the company. | | | `tags` | Record | :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/sync-for-expenses/docs/sdk/models/shared/companyreferencelinks.md b/sync-for-expenses/docs/sdk/models/shared/companyreferencelinks.md index 5d3c7889a..fbdbc8544 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyreferencelinks.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyreferencelinks.md @@ -1,17 +1,17 @@ -# CompanyReferenceLinks - -A collection of links for the company. - -## Example Usage - -```typescript -import { CompanyReferenceLinks } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyReferenceLinks = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | +# CompanyReferenceLinks + +A collection of links for the company. + +## Example Usage + +```typescript +import { CompanyReferenceLinks } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyReferenceLinks = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------- | --------------------------------------- | --------------------------------------- | --------------------------------------- | | `portal` | *string* | :heavy_minus_sign: | Link to the company page in the portal. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companyrequestbody.md b/sync-for-expenses/docs/sdk/models/shared/companyrequestbody.md index 1f7dc8ab1..fac143b54 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyrequestbody.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyrequestbody.md @@ -1,20 +1,20 @@ -# CompanyRequestBody - -## Example Usage - -```typescript -import { CompanyRequestBody } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyRequestBody = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | -| `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. | +# CompanyRequestBody + +## Example Usage + +```typescript +import { CompanyRequestBody } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyRequestBody = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_check_mark: | Name of company being connected. | Bank of Dave | +| `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. | | `tags` | Record | :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/sync-for-expenses/docs/sdk/models/shared/companysyncstatus.md b/sync-for-expenses/docs/sdk/models/shared/companysyncstatus.md index babb4dbd8..c2f3d21a6 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companysyncstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/companysyncstatus.md @@ -1,28 +1,27 @@ -# CompanySyncStatus - -## Example Usage - -```typescript -import { CompanySyncStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanySyncStatus = { - companyId: "d4d73051-ed31-42b6-99f6-d288cd940992", - syncId: "a6a22aff-a43a-411d-a910-2dae73217cce", - syncStatusCode: 2000, - syncStatus: "Complete", - syncUtc: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `companyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | d4d73051-ed31-42b6-99f6-d288cd940992 | -| `syncId` | *string* | :heavy_minus_sign: | Unique identifier of the sync. | a6a22aff-a43a-411d-a910-2dae73217cce | -| `syncStatusCode` | *number* | :heavy_minus_sign: | Status code of the sync. | 2000 | -| `syncStatus` | *string* | :heavy_minus_sign: | Text status of the sync. | **Example 1:** Complete
**Example 2:** PushError
**Example 3:** Started
**Example 4:** NotStarted
**Example 5:** Pushing | -| `errorMessage` | *string* | :heavy_minus_sign: | Error message of the sync. | | -| `syncExceptionMessage` | *string* | :heavy_minus_sign: | Exception message of the sync. | | -| `syncUtc` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dataPushed` | *boolean* | :heavy_minus_sign: | Boolean of whether the sync resulted in data being pushed. | | \ No newline at end of file +# CompanySyncStatus + +## Example Usage + +```typescript +import { CompanySyncStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanySyncStatus = { + companyId: "d4d73051-ed31-42b6-99f6-d288cd940992", + syncId: "a6a22aff-a43a-411d-a910-2dae73217cce", + syncStatusCode: 2000, + syncStatus: "Complete", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | +| `companyId` | *string* | :heavy_minus_sign: | Unique identifier for your SMB in Codat. | d4d73051-ed31-42b6-99f6-d288cd940992 | +| `syncId` | *string* | :heavy_minus_sign: | Unique identifier of the sync. | a6a22aff-a43a-411d-a910-2dae73217cce | +| `syncStatusCode` | *number* | :heavy_minus_sign: | Status code of the sync. | 2000 | +| `syncStatus` | *string* | :heavy_minus_sign: | Text status of the sync. | **Example 1:** Complete
**Example 2:** PushError
**Example 3:** Started
**Example 4:** NotStarted
**Example 5:** Pushing | +| `errorMessage` | *string* | :heavy_minus_sign: | Error message of the sync. | | +| `syncExceptionMessage` | *string* | :heavy_minus_sign: | Exception message of the sync. | | +| `syncUtc` | *string* | :heavy_minus_sign: | Datetime of the sync. | | +| `dataPushed` | *boolean* | :heavy_minus_sign: | Boolean of whether the sync resulted in data being pushed. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/companyupdaterequest.md b/sync-for-expenses/docs/sdk/models/shared/companyupdaterequest.md index 53f4afb62..9334f030f 100644 --- a/sync-for-expenses/docs/sdk/models/shared/companyupdaterequest.md +++ b/sync-for-expenses/docs/sdk/models/shared/companyupdaterequest.md @@ -1,20 +1,20 @@ -# CompanyUpdateRequest - -## Example Usage - -```typescript -import { CompanyUpdateRequest } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CompanyUpdateRequest = { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | -| `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. | +# CompanyUpdateRequest + +## Example Usage + +```typescript +import { CompanyUpdateRequest } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CompanyUpdateRequest = { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | Name of company being connected. | Bank of Dave | +| `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. | | `tags` | Record | :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/sync-for-expenses/docs/sdk/models/shared/connection.md b/sync-for-expenses/docs/sdk/models/shared/connection.md index 5992f0e7c..dfceabd5f 100644 --- a/sync-for-expenses/docs/sdk/models/shared/connection.md +++ b/sync-for-expenses/docs/sdk/models/shared/connection.md @@ -1,49 +1,48 @@ -# Connection - -A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - -A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - -- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. -- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. -- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. -Any combination of accounting, banking, and commerce data connections is allowed. - -Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). - -## Example Usage - -```typescript -import { Connection } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Connection = { - id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", - integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", - integrationKey: "dfxm", - sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", - sourceType: "Banking", - 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", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | -| `integrationKey` | *string* | :heavy_minus_sign: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | -| `sourceId` | *string* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | -| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | -| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | -| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | -| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | -| `connectionInfo` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file +# Connection + +A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + +A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: + +- [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. +- [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. +- [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. +Any combination of accounting, banking, and commerce data connections is allowed. + +Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + +## Example Usage + +```typescript +import { Connection } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Connection = { + id: "ee2eb431-c0fa-4dc9-93fa-d29781c12bcd", + integrationId: "bf083d72-62c7-493e-aec9-81b4dbba7e2c", + integrationKey: "dfxm", + sourceId: "bdd831ce-eebd-4896-89a7-20e5ee8989ee", + sourceType: "Banking", + 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", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `integrationId` | *string* | :heavy_check_mark: | A Codat ID representing the integration. | fd321cb6-7963-4506-b873-e99593a45e30 | +| `integrationKey` | *string* | :heavy_minus_sign: | A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. | | +| `sourceId` | *string* | :heavy_check_mark: | A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. | 35b92968-9851-4095-ad60-395c95cbcba4 | +| `sourceType` | [shared.SourceType](../../../sdk/models/shared/sourcetype.md) | :heavy_check_mark: | The type of platform of the connection. | Accounting | +| `platformName` | *string* | :heavy_check_mark: | Name of integration connected to company. | | +| `linkUrl` | *string* | :heavy_check_mark: | The link URL your customers can use to authorize access to their business application. | https://link-api.codat.io/companies/86bd88cb-44ab-4dfb-b32f-87b19b14287f/connections/2e2eb431-c1fa-4dc9-93fa-d29781c12bcd/start | +| `status` | [shared.DataConnectionStatus](../../../sdk/models/shared/dataconnectionstatus.md) | :heavy_check_mark: | The current authorization status of the data connection. | | +| `lastSync` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | | +| `created` | *string* | :heavy_check_mark: | Date of the transfer transaction as recorded in the accounting software. | | +| `dataConnectionErrors` | [shared.DataConnectionError](../../../sdk/models/shared/dataconnectionerror.md)[] | :heavy_minus_sign: | N/A | | +| `connectionInfo` | Record | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/connections.md b/sync-for-expenses/docs/sdk/models/shared/connections.md index 7660dd1cb..6b5177d2f 100644 --- a/sync-for-expenses/docs/sdk/models/shared/connections.md +++ b/sync-for-expenses/docs/sdk/models/shared/connections.md @@ -1,31 +1,23 @@ -# Connections - -## Example Usage - -```typescript -import { Connections } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Connections = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Connections + +## Example Usage + +```typescript +import { Connections } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Connections = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | --------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Connection](../../../sdk/models/shared/connection.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/contact.md b/sync-for-expenses/docs/sdk/models/shared/contact.md index f286d1cd0..8d53074e2 100644 --- a/sync-for-expenses/docs/sdk/models/shared/contact.md +++ b/sync-for-expenses/docs/sdk/models/shared/contact.md @@ -1,29 +1,20 @@ -# Contact - -## Example Usage - -```typescript -import { Contact } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Contact = { - phone: [ - { - number: "+44 25691 154789", - type: "Landline", - }, - ], - status: "Unknown", - modifiedDate: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `name` | *string* | :heavy_minus_sign: | Name of a contact for a customer. | | -| `email` | *string* | :heavy_minus_sign: | Email of a contact for a customer. | | -| `phone` | [shared.PhoneNumberItems](../../../sdk/models/shared/phonenumberitems.md)[] | :heavy_minus_sign: | An array of Phone numbers. | | -| `address` | [shared.Items](../../../sdk/models/shared/items.md) | :heavy_minus_sign: | N/A | | -| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# Contact + +## Example Usage + +```typescript +import { Contact } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Contact = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `name` | *string* | :heavy_minus_sign: | Name of a contact for a customer. | +| `email` | *string* | :heavy_minus_sign: | Email of a contact for a customer. | +| `phone` | [shared.PhoneNumberItems](../../../sdk/models/shared/phonenumberitems.md)[] | :heavy_minus_sign: | An array of Phone numbers. | +| `address` | [shared.Items](../../../sdk/models/shared/items.md) | :heavy_minus_sign: | An object of Address information. | +| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | N/A | +| `modifiedDate` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createaccountresponse.md b/sync-for-expenses/docs/sdk/models/shared/createaccountresponse.md index b0420917d..0b75dbfde 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createaccountresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/createaccountresponse.md @@ -1,60 +1,36 @@ -# CreateAccountResponse - -## Example Usage - -```typescript -import { CreateAccountResponse } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: CreateAccountResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - id: "1b6266d1-1e44-46c5-8eb5-a8f98e03124e", - nominalCode: "610", - name: "Accounts Receivable", - description: - "Invoices the business has issued but has not yet collected payment on.", - fullyQualifiedCategory: "Asset.Current", - fullyQualifiedName: "Cash On Hand", - currency: "GBP", - currentBalance: new Decimal("0"), - type: "Asset", - status: "Active", - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "288aa3e0-a66e-4df2-8ee4-f8a9f9cc1670", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Pending", - statusCode: 95026, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.AccountingAccount](../../../sdk/models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# CreateAccountResponse + +## Example Usage + +```typescript +import { CreateAccountResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateAccountResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | [shared.AccountingAccount](../../../sdk/models/shared/accountingaccount.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createaccountresponsemetadata.md b/sync-for-expenses/docs/sdk/models/shared/createaccountresponsemetadata.md index 09974cb78..55d239eb9 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createaccountresponsemetadata.md +++ b/sync-for-expenses/docs/sdk/models/shared/createaccountresponsemetadata.md @@ -1,15 +1,15 @@ -# CreateAccountResponseMetadata - -## Example Usage - -```typescript -import { CreateAccountResponseMetadata } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateAccountResponseMetadata = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +# CreateAccountResponseMetadata + +## Example Usage + +```typescript +import { CreateAccountResponseMetadata } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateAccountResponseMetadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `isDeleted` | *boolean* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createaccountresponsevaliddatatypelinks.md b/sync-for-expenses/docs/sdk/models/shared/createaccountresponsevaliddatatypelinks.md index 00318b7e2..8276c4c53 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createaccountresponsevaliddatatypelinks.md +++ b/sync-for-expenses/docs/sdk/models/shared/createaccountresponsevaliddatatypelinks.md @@ -1,57 +1,16 @@ -# CreateAccountResponseValidDataTypeLinks - -When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. - -For example, `validDatatypeLinks` might indicate the following references: - -- Which tax rates are valid to use on the line item of a bill. -- Which items can be used when creating an invoice. - -You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. - -## `validDatatypeLinks` example - -The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. - -```json validDatatypeLinks for an account -{ - "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", - "nominalCode": "090", - "name": "Business Bank Account", - #... - "validDatatypeLinks": [ - { - "property": "Id", - "links": [ - "Payment.AccountRef.Id", - "BillPayment.AccountRef.Id", - "DirectIncome.LineItems.AccountRef.Id", - "DirectCost.LineItems.AccountRef.Id" - ] - } - ] - } -``` - - - -## Support for `validDatatypeLinks` - -Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. - -If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. - -## Example Usage - -```typescript -import { CreateAccountResponseValidDataTypeLinks } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateAccountResponseValidDataTypeLinks = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `property` | *string* | :heavy_minus_sign: | The property from the account that can be linked. | +# CreateAccountResponseValidDataTypeLinks + +## Example Usage + +```typescript +import { CreateAccountResponseValidDataTypeLinks } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateAccountResponseValidDataTypeLinks = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `property` | *string* | :heavy_minus_sign: | The property from the account that can be linked. | | `links` | *string*[] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponse.md b/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponse.md index 7205d6bae..5338c58f5 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponse.md @@ -1,50 +1,36 @@ -# CreateBankAccountResponse - -## Example Usage - -```typescript -import { CreateBankAccountResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateBankAccountResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "7022f410-4479-48de-8a8e-dbe049de7d31", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Failed", - statusCode: 962308, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.AccountingBankAccount](../../../sdk/models/shared/accountingbankaccount.md) | :heavy_minus_sign: | N/A | | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# CreateBankAccountResponse + +## Example Usage + +```typescript +import { CreateBankAccountResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateBankAccountResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | *AccountingBankAccount* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponsebankaccounttype.md b/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponsebankaccounttype.md index 1b4c93f61..b760f8fd9 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponsebankaccounttype.md +++ b/sync-for-expenses/docs/sdk/models/shared/createbankaccountresponsebankaccounttype.md @@ -1,19 +1,15 @@ -# CreateBankAccountResponseBankAccountType - -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. - -## Example Usage - -```typescript -import { CreateBankAccountResponseBankAccountType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateBankAccountResponseBankAccountType = "Debit"; -``` - -## Values - -```typescript -"Unknown" | "Credit" | "Debit" +# CreateBankAccountResponseBankAccountType + +## Example Usage + +```typescript +import { CreateBankAccountResponseBankAccountType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateBankAccountResponseBankAccountType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createcustomerresponse.md b/sync-for-expenses/docs/sdk/models/shared/createcustomerresponse.md index 9839b28b7..e778e5287 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createcustomerresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/createcustomerresponse.md @@ -1,57 +1,36 @@ -# CreateCustomerResponse - -## Example Usage - -```typescript -import { CreateCustomerResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateCustomerResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Archived", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Archived", - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "45a8ae94-4cad-4e4b-8b91-b18ba2467f2e", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Success", - statusCode: 203449, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.AccountingCustomer](../../../sdk/models/shared/accountingcustomer.md) | :heavy_minus_sign: | N/A | | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# CreateCustomerResponse + +## Example Usage + +```typescript +import { CreateCustomerResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateCustomerResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | *AccountingCustomer* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createexpenseresponse.md b/sync-for-expenses/docs/sdk/models/shared/createexpenseresponse.md index d6e45144f..95ac2c616 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createexpenseresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/createexpenseresponse.md @@ -1,17 +1,17 @@ -# CreateExpenseResponse - -## Example Usage - -```typescript -import { CreateExpenseResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateExpenseResponse = { - syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# CreateExpenseResponse + +## Example Usage + +```typescript +import { CreateExpenseResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateExpenseResponse = { + syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `syncId` | *string* | :heavy_minus_sign: | Unique id of sync created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createreimbursableexpenseresponse.md b/sync-for-expenses/docs/sdk/models/shared/createreimbursableexpenseresponse.md index c6e99671e..cd0c55296 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createreimbursableexpenseresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/createreimbursableexpenseresponse.md @@ -1,17 +1,17 @@ -# CreateReimbursableExpenseResponse - -## Example Usage - -```typescript -import { CreateReimbursableExpenseResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateReimbursableExpenseResponse = { - syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# CreateReimbursableExpenseResponse + +## Example Usage + +```typescript +import { CreateReimbursableExpenseResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateReimbursableExpenseResponse = { + syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `syncId` | *string* | :heavy_minus_sign: | Unique id of sync created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/createsupplierresponse.md b/sync-for-expenses/docs/sdk/models/shared/createsupplierresponse.md index 463bbad39..7f1fcb37f 100644 --- a/sync-for-expenses/docs/sdk/models/shared/createsupplierresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/createsupplierresponse.md @@ -1,82 +1,75 @@ -# CreateSupplierResponse - -## Example Usage - -```typescript -import { CreateSupplierResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CreateSupplierResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "5f97f72b-e5f2-4a73-8ae8-a9449b63f872", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "TimedOut", - statusCode: 979635, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.AccountingSupplier](../../../sdk/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"
} | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# CreateSupplierResponse + +## Example Usage + +```typescript +import { CreateSupplierResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CreateSupplierResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, + data: { + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | *AccountingSupplier* | :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"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/customer.md b/sync-for-expenses/docs/sdk/models/shared/customer.md index 18c747e2b..334cedad5 100644 --- a/sync-for-expenses/docs/sdk/models/shared/customer.md +++ b/sync-for-expenses/docs/sdk/models/shared/customer.md @@ -1,48 +1,41 @@ -# Customer - -## Overview - -A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - -Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - - -## Example Usage - -```typescript -import { Customer } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Customer = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Archived", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Archived", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | -| `customerName` | *string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `phone` | *string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | -| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `contacts` | [shared.Contact](../../../sdk/models/shared/contact.md)[] | :heavy_minus_sign: | An array of Contacts. | | -| `registrationNumber` | *string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | | -| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +# Customer + +## Overview + +A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). + +Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + + +## Example Usage + +```typescript +import { Customer } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Customer = { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + defaultCurrency: "GBP", + status: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | +| `customerName` | *string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address the customer can be contacted by. | | +| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | +| `phone` | *string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | +| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | +| `contacts` | [shared.Contact](../../../sdk/models/shared/contact.md)[] | :heavy_minus_sign: | An array of Contacts. | | +| `registrationNumber` | *string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | +| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | | +| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `supplementalData` | [shared.SupplementalData](../../../sdk/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/sync-for-expenses/docs/sdk/models/shared/customerdetails.md b/sync-for-expenses/docs/sdk/models/shared/customerdetails.md index 3ad932471..d49ade728 100644 --- a/sync-for-expenses/docs/sdk/models/shared/customerdetails.md +++ b/sync-for-expenses/docs/sdk/models/shared/customerdetails.md @@ -1,15 +1,15 @@ -# CustomerDetails - -## Example Usage - -```typescript -import { CustomerDetails } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CustomerDetails = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +# CustomerDetails + +## Example Usage + +```typescript +import { CustomerDetails } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CustomerDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/customers.md b/sync-for-expenses/docs/sdk/models/shared/customers.md index 1027cef14..bb547eae2 100644 --- a/sync-for-expenses/docs/sdk/models/shared/customers.md +++ b/sync-for-expenses/docs/sdk/models/shared/customers.md @@ -1,31 +1,23 @@ -# Customers - -## Example Usage - -```typescript -import { Customers } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Customers = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Customer](../../../sdk/models/shared/customer.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Customers + +## Example Usage + +```typescript +import { Customers } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Customers = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Customer](../../../sdk/models/shared/customer.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/customerstatus.md b/sync-for-expenses/docs/sdk/models/shared/customerstatus.md index d58f3bb08..842960bcf 100644 --- a/sync-for-expenses/docs/sdk/models/shared/customerstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/customerstatus.md @@ -1,17 +1,17 @@ -# CustomerStatus - -Status of customer. - -## Example Usage - -```typescript -import { CustomerStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: CustomerStatus = "Unknown"; -``` - -## Values - -```typescript -"Unknown" | "Active" | "Archived" +# CustomerStatus + +Status of customer. + +## Example Usage + +```typescript +import { CustomerStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: CustomerStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Active" | "Archived" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/dataconnectionerror.md b/sync-for-expenses/docs/sdk/models/shared/dataconnectionerror.md index d61074d99..a76ba7591 100644 --- a/sync-for-expenses/docs/sdk/models/shared/dataconnectionerror.md +++ b/sync-for-expenses/docs/sdk/models/shared/dataconnectionerror.md @@ -1,23 +1,20 @@ -# DataConnectionError - -## Example Usage - -```typescript -import { DataConnectionError } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DataConnectionError = { - erroredOnUtc: "2022-10-23T00:00:00Z", - resolvedOnUtc: "2022-10-23T00:00:00Z", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `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. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `status` | [shared.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | \ No newline at end of file +# DataConnectionError + +## Example Usage + +```typescript +import { DataConnectionError } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DataConnectionError = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------ | +| `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. | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about a error returned by Codat. | +| `erroredOnUtc` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | +| `status` | [shared.ErrorStatus](../../../sdk/models/shared/errorstatus.md) | :heavy_minus_sign: | The current status of a transient error. Null statuses indicate that the error is not transient. | +| `resolvedOnUtc` | *string* | :heavy_minus_sign: | The datetime in Utc that the error was resolved. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/dataconnectionstatus.md b/sync-for-expenses/docs/sdk/models/shared/dataconnectionstatus.md index cb907c671..46caa24a2 100644 --- a/sync-for-expenses/docs/sdk/models/shared/dataconnectionstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/dataconnectionstatus.md @@ -1,17 +1,17 @@ -# DataConnectionStatus - -The current authorization status of the data connection. - -## Example Usage - -```typescript -import { DataConnectionStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DataConnectionStatus = "Deauthorized"; -``` - -## Values - -```typescript -"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" +# DataConnectionStatus + +The current authorization status of the data connection. + +## Example Usage + +```typescript +import { DataConnectionStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DataConnectionStatus = "PendingAuth"; +``` + +## Values + +```typescript +"PendingAuth" | "Linked" | "Unlinked" | "Deauthorized" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/datasetstatus.md b/sync-for-expenses/docs/sdk/models/shared/datasetstatus.md index 7969d3316..f0f6cfd17 100644 --- a/sync-for-expenses/docs/sdk/models/shared/datasetstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/datasetstatus.md @@ -1,17 +1,17 @@ -# DatasetStatus - -The current status of the dataset. - -## Example Usage - -```typescript -import { DatasetStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DatasetStatus = "RateLimitError"; -``` - -## Values - -```typescript -"Initial" | "Queued" | "Fetching" | "MapQueued" | "Mapping" | "Complete" | "FetchError" | "MapError" | "InternalError" | "ProcessingQueued" | "Processing" | "ProcessingError" | "ValidationQueued" | "Validating" | "ValidationError" | "AuthError" | "Cancelled" | "NotSupported" | "RateLimitError" | "PermissionsError" | "PrerequisiteNotMet" +# DatasetStatus + +The current status of the dataset. + +## Example Usage + +```typescript +import { DatasetStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DatasetStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/datastatus.md b/sync-for-expenses/docs/sdk/models/shared/datastatus.md index 23cfe858a..f29678afe 100644 --- a/sync-for-expenses/docs/sdk/models/shared/datastatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/datastatus.md @@ -1,27 +1,27 @@ -# DataStatus - -Describes the state of data in the Codat cache for a company and data type - -## Example Usage - -```typescript -import { DataStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DataStatus = { - dataType: "itemReceipts", - lastSuccessfulSync: "2022-01-01T13:00:00.000Z", - currentStatus: "Processing", - latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", - latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `dataType` | [shared.DataTypes](../../../sdk/models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | -| `lastSuccessfulSync` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currentStatus` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | -| `latestSyncId` | *string* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | -| `latestSuccessfulSyncId` | *string* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | \ No newline at end of file +# DataStatus + +Describes the state of data in the Codat cache for a company and data type + +## Example Usage + +```typescript +import { DataStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DataStatus = { + dataType: "string", + lastSuccessfulSync: "2022-01-01T13:00:00.000Z", + currentStatus: "string", + latestSyncId: "ad474a37-2003-478e-baee-9af9f1ec2fe3", + latestSuccessfulSyncId: "8220fc90-55b6-47bc-9417-48ac6ea93101", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `dataType` | [shared.DataTypes](../../../sdk/models/shared/datatypes.md) | :heavy_check_mark: | Available data types | invoices | +| `lastSuccessfulSync` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | | +| `currentStatus` | [shared.Status](../../../sdk/models/shared/status.md) | :heavy_check_mark: | The current status of the dataset. | | +| `latestSyncId` | *string* | :heavy_minus_sign: | Unique identifier for most recent sync of data type. | ad474a37-2003-478e-baee-9af9f1ec2fe3 | +| `latestSuccessfulSyncId` | *string* | :heavy_minus_sign: | Unique identifier for the most recent successful sync of data type. | 8220fc90-55b6-47bc-9417-48ac6ea93101 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/datatype.md b/sync-for-expenses/docs/sdk/models/shared/datatype.md index de4a6935d..b9be0cc20 100644 --- a/sync-for-expenses/docs/sdk/models/shared/datatype.md +++ b/sync-for-expenses/docs/sdk/models/shared/datatype.md @@ -1,17 +1,17 @@ -# DataType - -Available data types - -## Example Usage - -```typescript -import { DataType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DataType = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# DataType + +Available data types + +## Example Usage + +```typescript +import { DataType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DataType = "accountTransactions"; +``` + +## Values + +```typescript +"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/datatypes.md b/sync-for-expenses/docs/sdk/models/shared/datatypes.md index 551a8b937..f719d2dad 100644 --- a/sync-for-expenses/docs/sdk/models/shared/datatypes.md +++ b/sync-for-expenses/docs/sdk/models/shared/datatypes.md @@ -1,17 +1,17 @@ -# DataTypes - -Available data types - -## Example Usage - -```typescript -import { DataTypes } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DataTypes = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# DataTypes + +Available data types + +## Example Usage + +```typescript +import { DataTypes } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DataTypes = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/definitiontransaction.md b/sync-for-expenses/docs/sdk/models/shared/definitiontransaction.md index 906e07b82..b26aa85ba 100644 --- a/sync-for-expenses/docs/sdk/models/shared/definitiontransaction.md +++ b/sync-for-expenses/docs/sdk/models/shared/definitiontransaction.md @@ -1,17 +1,17 @@ -# DefinitionTransaction - -## Example Usage - -```typescript -import { DefinitionTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: DefinitionTransaction = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the transaction. | -| `status` | [shared.TransactionStatus1](../../../sdk/models/shared/transactionstatus1.md) | :heavy_minus_sign: | Status of transaction. | +# DefinitionTransaction + +## Example Usage + +```typescript +import { DefinitionTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: DefinitionTransaction = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the transaction. | +| `status` | [shared.TransactionStatus1](../../../sdk/models/shared/transactionstatus1.md) | :heavy_minus_sign: | Status of transaction. | | `errorMessage` | *string* | :heavy_minus_sign: | Error message for failed transaction. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/errorstatus.md b/sync-for-expenses/docs/sdk/models/shared/errorstatus.md index 4fb4cb0ff..dc08326a8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/errorstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/errorstatus.md @@ -1,17 +1,17 @@ -# ErrorStatus - -The current status of a transient error. Null statuses indicate that the error is not transient. - -## Example Usage - -```typescript -import { ErrorStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ErrorStatus = "Resolved"; -``` - -## Values - -```typescript -"Active" | "Resolved" +# ErrorStatus + +The current status of a transient error. Null statuses indicate that the error is not transient. + +## Example Usage + +```typescript +import { ErrorStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ErrorStatus = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/errorvalidation.md b/sync-for-expenses/docs/sdk/models/shared/errorvalidation.md index 23c0ea69b..f5d21b251 100644 --- a/sync-for-expenses/docs/sdk/models/shared/errorvalidation.md +++ b/sync-for-expenses/docs/sdk/models/shared/errorvalidation.md @@ -1,18 +1,18 @@ -# ErrorValidation - -A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { ErrorValidation } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ErrorValidation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | +# ErrorValidation + +A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { ErrorValidation } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ErrorValidation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `errors` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ErrorValidationItem](../../../sdk/models/shared/errorvalidationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/errorvalidationitem.md b/sync-for-expenses/docs/sdk/models/shared/errorvalidationitem.md index 2629f578a..d488cacad 100644 --- a/sync-for-expenses/docs/sdk/models/shared/errorvalidationitem.md +++ b/sync-for-expenses/docs/sdk/models/shared/errorvalidationitem.md @@ -1,17 +1,17 @@ -# ErrorValidationItem - -## Example Usage - -```typescript -import { ErrorValidationItem } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ErrorValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ErrorValidationItem + +## Example Usage + +```typescript +import { ErrorValidationItem } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ErrorValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/expensecontactref.md b/sync-for-expenses/docs/sdk/models/shared/expensecontactref.md index 482ec9a63..3e1535ca6 100644 --- a/sync-for-expenses/docs/sdk/models/shared/expensecontactref.md +++ b/sync-for-expenses/docs/sdk/models/shared/expensecontactref.md @@ -1,18 +1,19 @@ -# ExpenseContactRef - -## Example Usage - -```typescript -import { ExpenseContactRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ExpenseContactRef = { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Identifier of supplier or customer. | 40e3e57c-2322-4898-966c-ca41adfd23fd | +# ExpenseContactRef + +## Example Usage + +```typescript +import { ExpenseContactRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ExpenseContactRef = { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + type: "Supplier", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Identifier of supplier or customer. | 40e3e57c-2322-4898-966c-ca41adfd23fd | | `type` | [shared.ExpenseContactRefType](../../../sdk/models/shared/expensecontactreftype.md) | :heavy_minus_sign: | The type of contact. | Supplier | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/expensecontactreftype.md b/sync-for-expenses/docs/sdk/models/shared/expensecontactreftype.md index c86ea87a9..32a4613a8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/expensecontactreftype.md +++ b/sync-for-expenses/docs/sdk/models/shared/expensecontactreftype.md @@ -1,17 +1,15 @@ -# ExpenseContactRefType - -The type of contact. - -## Example Usage - -```typescript -import { ExpenseContactRefType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ExpenseContactRefType = "Supplier"; -``` - -## Values - -```typescript -"Supplier" +# ExpenseContactRefType + +## Example Usage + +```typescript +import { ExpenseContactRefType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ExpenseContactRefType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhook.md b/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhook.md index 6ad920275..7dd197354 100644 --- a/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhook.md +++ b/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhook.md @@ -1,29 +1,21 @@ -# ExpensesSyncWebhook - -## Example Usage - -```typescript -import { ExpensesSyncWebhook } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ExpensesSyncWebhook = { - id: "ba29118f-5406-4e59-b05c-ba307ca38d01", - eventType: "expenses.sync.successful", - generatedDate: "2022-10-23T00:00:00Z", - payload: { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | -| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** expenses.sync.successful
**Example 2:** expenses.sync.unsuccessful | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `payload` | [shared.ExpensesSyncWebhookPayload](../../../sdk/models/shared/expensessyncwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file +# ExpensesSyncWebhook + +## Example Usage + +```typescript +import { ExpensesSyncWebhook } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ExpensesSyncWebhook = { + id: "ba29118f-5406-4e59-b05c-ba307ca38d01", + eventType: "expenses.sync.successful", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the event. | ba29118f-5406-4e59-b05c-ba307ca38d01 | +| `eventType` | *string* | :heavy_minus_sign: | The type of event. | **Example 1:** expenses.sync.successful
**Example 2:** expenses.sync.unsuccessful | +| `generatedDate` | *string* | :heavy_minus_sign: | The date time in UTC the event was generated in Codat. | | +| `payload` | [shared.ExpensesSyncWebhookPayload](../../../sdk/models/shared/expensessyncwebhookpayload.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhookpayload.md b/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhookpayload.md index f50b74cb2..c514465a8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhookpayload.md +++ b/sync-for-expenses/docs/sdk/models/shared/expensessyncwebhookpayload.md @@ -1,23 +1,17 @@ -# ExpensesSyncWebhookPayload - -## Example Usage - -```typescript -import { ExpensesSyncWebhookPayload } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ExpensesSyncWebhookPayload = { - referenceCompany: { - id: "8a210b68-6988-11ed-a1eb-0242ac120002", - name: "Codat Ltd.", - description: "Requested early access to the new financing scheme.", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | -| `syncId` | *string* | :heavy_minus_sign: | Unique identifier of the sync. | +# ExpensesSyncWebhookPayload + +## Example Usage + +```typescript +import { ExpensesSyncWebhookPayload } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ExpensesSyncWebhookPayload = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `referenceCompany` | [shared.CompanyReference](../../../sdk/models/shared/companyreference.md) | :heavy_minus_sign: | N/A | +| `syncId` | *string* | :heavy_minus_sign: | Unique identifier of the sync. | | `transactions` | [shared.DefinitionTransaction](../../../sdk/models/shared/definitiontransaction.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/expensetransaction.md b/sync-for-expenses/docs/sdk/models/shared/expensetransaction.md index 3cc7436d3..5ab630f72 100644 --- a/sync-for-expenses/docs/sdk/models/shared/expensetransaction.md +++ b/sync-for-expenses/docs/sdk/models/shared/expensetransaction.md @@ -1,63 +1,65 @@ -# ExpenseTransaction - -## Example Usage - -```typescript -import { ExpenseTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: ExpenseTransaction = { - id: "a44135b0-6882-489a-83fe-a0c57a4afb19", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_3", - }, - {}, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "amazon purchase", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | -| `type` | [shared.Type](../../../sdk/models/shared/type.md) | :heavy_check_mark: | The type of transaction. | Payment | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | -| `contactRef` | [shared.ExpenseContactRef](../../../sdk/models/shared/expensecontactref.md) | :heavy_minus_sign: | N/A | | -| `bankAccountRef` | [shared.BankAccountReference](../../../sdk/models/shared/bankaccountreference.md) | :heavy_minus_sign: | N/A | | -| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the expense transaction. | | -| `merchantName` | *string* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | -| `lines` | [shared.ExpenseTransactionLine](../../../sdk/models/shared/expensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | -| `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +# ExpenseTransaction + +## Example Usage + +```typescript +import { ExpenseTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ExpenseTransaction = { + id: "a44135b0-6882-489a-83fe-a0c57a4afb19", + type: "Payment", + issueDate: "2024-05-21T00:00:00+00:00", + currency: "GBP", + currencyRate: 1, + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_3", + }, + { + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + notes: "amazon purchase", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | +| `type` | [shared.Type](../../../sdk/models/shared/type.md) | :heavy_check_mark: | The type of transaction. | Payment | +| `issueDate` | *string* | :heavy_check_mark: | Date of the transaction was recorded. | | +| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `currencyRate` | *Decimal | number* | :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. \| | | +| `contactRef` | [shared.ExpenseContactRef](../../../sdk/models/shared/expensecontactref.md) | :heavy_minus_sign: | Supplier or customer for the purchase to be associated to. | | +| `bankAccountRef` | [shared.BankAccountReference](../../../sdk/models/shared/bankaccountreference.md) | :heavy_minus_sign: | N/A | | +| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the expense transaction. | | +| `merchantName` | *string* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | +| `lines` | [shared.ExpenseTransactionLine](../../../sdk/models/shared/expensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | +| `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | | `postAsDraft` | *boolean* | :heavy_minus_sign: | This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/expensetransactionline.md b/sync-for-expenses/docs/sdk/models/shared/expensetransactionline.md index 483a5a4fb..5d7232fc5 100644 --- a/sync-for-expenses/docs/sdk/models/shared/expensetransactionline.md +++ b/sync-for-expenses/docs/sdk/models/shared/expensetransactionline.md @@ -1,43 +1,24 @@ -# ExpenseTransactionLine - -## Example Usage - -```typescript -import { ExpenseTransactionLine } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: ExpenseTransactionLine = { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `netAmount` | *Decimal* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 100 | -| `taxAmount` | *Decimal* | :heavy_minus_sign: | Amount of tax for the line. | 20 | -| `taxRateRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | N/A | | -| `accountRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | N/A | | -| `itemRef` | [shared.ItemRef](../../../sdk/models/shared/itemref.md) | :heavy_minus_sign: | N/A | | -| `trackingRefs` | [shared.TrackingRef](../../../sdk/models/shared/trackingref.md)[] | :heavy_minus_sign: | N/A | | -| `invoiceTo` | [shared.InvoiceTo](../../../sdk/models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | \ No newline at end of file +# ExpenseTransactionLine + +## Example Usage + +```typescript +import { ExpenseTransactionLine } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ExpenseTransactionLine = { + netAmount: 100, + taxAmount: 20, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `netAmount` | *Decimal | number* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 100 | +| `taxAmount` | *Decimal | number* | :heavy_minus_sign: | Amount of tax for the line. | 20 | +| `taxRateRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | N/A | | +| `accountRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. | | +| `itemRef` | [shared.ItemRef](../../../sdk/models/shared/itemref.md) | :heavy_minus_sign: | N/A | | +| `trackingRefs` | [shared.TrackingRef](../../../sdk/models/shared/trackingref.md)[] | :heavy_minus_sign: | N/A | | +| `invoiceTo` | [shared.InvoiceTo](../../../sdk/models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/from.md b/sync-for-expenses/docs/sdk/models/shared/from.md index 02c04adb2..23e0626ce 100644 --- a/sync-for-expenses/docs/sdk/models/shared/from.md +++ b/sync-for-expenses/docs/sdk/models/shared/from.md @@ -1,22 +1,16 @@ -# From - -## Example Usage - -```typescript -import { From } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: From = { - accountRef: { - id: "", - }, - amount: new Decimal("5875.77"), -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | -| `accountRef` | [shared.AccountReference](../../../sdk/models/shared/accountreference.md) | :heavy_check_mark: | Reference of the account you are transferring money from. | -| `amount` | *Decimal* | :heavy_check_mark: | Amount that has been transferred from the account in the native currency of the account. | \ No newline at end of file +# From + +## Example Usage + +```typescript +import { From } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: From = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- | +| `accountRef` | [shared.AccountReference](../../../sdk/models/shared/accountreference.md) | :heavy_check_mark: | N/A | +| `amount` | *Decimal | number* | :heavy_check_mark: | Amount that has been transferred from the account in the native currency of the account. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/halref.md b/sync-for-expenses/docs/sdk/models/shared/halref.md index 776eeb4da..a2f41381a 100644 --- a/sync-for-expenses/docs/sdk/models/shared/halref.md +++ b/sync-for-expenses/docs/sdk/models/shared/halref.md @@ -1,15 +1,15 @@ -# HalRef - -## Example Usage - -```typescript -import { HalRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: HalRef = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------ | ------------------------ | ------------------------ | ------------------------ | +# HalRef + +## Example Usage + +```typescript +import { HalRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: HalRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------ | ------------------------ | ------------------------ | ------------------------ | | `href` | *string* | :heavy_minus_sign: | Uri hypertext reference. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/integrationtype.md b/sync-for-expenses/docs/sdk/models/shared/integrationtype.md index 10dbd0e52..9ba3f3435 100644 --- a/sync-for-expenses/docs/sdk/models/shared/integrationtype.md +++ b/sync-for-expenses/docs/sdk/models/shared/integrationtype.md @@ -1,17 +1,17 @@ -# IntegrationType - -Type of transaction that has been processed e.g. Expense or Bank Feed. - -## Example Usage - -```typescript -import { IntegrationType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: IntegrationType = "expenses"; -``` - -## Values - -```typescript -"expenses" | "bankfeeds" +# IntegrationType + +Type of transaction that has been processed e.g. Expense or Bank Feed. + +## Example Usage + +```typescript +import { IntegrationType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: IntegrationType = "expenses"; +``` + +## Values + +```typescript +"expenses" | "bankfeeds" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/invoiceto.md b/sync-for-expenses/docs/sdk/models/shared/invoiceto.md index f9b695f1b..146bc6be5 100644 --- a/sync-for-expenses/docs/sdk/models/shared/invoiceto.md +++ b/sync-for-expenses/docs/sdk/models/shared/invoiceto.md @@ -1,21 +1,21 @@ -# InvoiceTo - -Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. - -## Example Usage - -```typescript -import { InvoiceTo } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: InvoiceTo = { - id: "80000002-1674552702", - type: "customer", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | identifier of customer. | 80000002-1674552702 | +# InvoiceTo + +Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. + +## Example Usage + +```typescript +import { InvoiceTo } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: InvoiceTo = { + id: "80000002-1674552702", + type: "customer", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | ------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | identifier of customer. | 80000002-1674552702 | | `type` | [shared.InvoiceToType](../../../sdk/models/shared/invoicetotype.md) | :heavy_minus_sign: | The type of contact. | customer | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/invoicetotype.md b/sync-for-expenses/docs/sdk/models/shared/invoicetotype.md index 208ce8272..7843d8ad6 100644 --- a/sync-for-expenses/docs/sdk/models/shared/invoicetotype.md +++ b/sync-for-expenses/docs/sdk/models/shared/invoicetotype.md @@ -1,17 +1,15 @@ -# InvoiceToType - -The type of contact. - -## Example Usage - -```typescript -import { InvoiceToType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: InvoiceToType = "customer"; -``` - -## Values - -```typescript -"customer" +# InvoiceToType + +## Example Usage + +```typescript +import { InvoiceToType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: InvoiceToType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/itemref.md b/sync-for-expenses/docs/sdk/models/shared/itemref.md index 49ca6cd52..3ec6cd468 100644 --- a/sync-for-expenses/docs/sdk/models/shared/itemref.md +++ b/sync-for-expenses/docs/sdk/models/shared/itemref.md @@ -1,17 +1,17 @@ -# ItemRef - -## Example Usage - -```typescript -import { ItemRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ItemRef = { - id: "80000002-1675158984", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +# ItemRef + +## Example Usage + +```typescript +import { ItemRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ItemRef = { + id: "80000002-1675158984", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. | 80000002-1675158984 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/items.md b/sync-for-expenses/docs/sdk/models/shared/items.md index 3fd970a9f..737139853 100644 --- a/sync-for-expenses/docs/sdk/models/shared/items.md +++ b/sync-for-expenses/docs/sdk/models/shared/items.md @@ -1,23 +1,21 @@ -# Items - -## Example Usage - -```typescript -import { Items } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Items = { - type: "Billing", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | -| `type` | [shared.AccountingAddressType](../../../sdk/models/shared/accountingaddresstype.md) | :heavy_check_mark: | The type of the address | -| `line1` | *string* | :heavy_minus_sign: | Line 1 of the customer address. | -| `line2` | *string* | :heavy_minus_sign: | Line 2 of the customer address. | -| `city` | *string* | :heavy_minus_sign: | City of the customer address. | -| `region` | *string* | :heavy_minus_sign: | Region of the customer address. | -| `country` | *string* | :heavy_minus_sign: | Country of the customer address. | +# Items + +## Example Usage + +```typescript +import { Items } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Items = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------- | +| `type` | [shared.AccountingAddressType](../../../sdk/models/shared/accountingaddresstype.md) | :heavy_check_mark: | N/A | +| `line1` | *string* | :heavy_minus_sign: | Line 1 of the customer address. | +| `line2` | *string* | :heavy_minus_sign: | Line 2 of the customer address. | +| `city` | *string* | :heavy_minus_sign: | City of the customer address. | +| `region` | *string* | :heavy_minus_sign: | Region of the customer address. | +| `country` | *string* | :heavy_minus_sign: | Country of the customer address. | | `postalCode` | *string* | :heavy_minus_sign: | Postal code or zip code. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/itemstype.md b/sync-for-expenses/docs/sdk/models/shared/itemstype.md index a29cdee3c..714ac4bc7 100644 --- a/sync-for-expenses/docs/sdk/models/shared/itemstype.md +++ b/sync-for-expenses/docs/sdk/models/shared/itemstype.md @@ -1,17 +1,15 @@ -# ItemsType - -The type of phone number - -## Example Usage - -```typescript -import { ItemsType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ItemsType = "Primary"; -``` - -## Values - -```typescript -"Primary" | "Landline" | "Mobile" | "Fax" | "Unknown" +# ItemsType + +## Example Usage + +```typescript +import { ItemsType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ItemsType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/links.md b/sync-for-expenses/docs/sdk/models/shared/links.md index d6a06ed47..a4b877c81 100644 --- a/sync-for-expenses/docs/sdk/models/shared/links.md +++ b/sync-for-expenses/docs/sdk/models/shared/links.md @@ -1,25 +1,18 @@ -# Links - -## Example Usage - -```typescript -import { Links } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Links = { - self: { - href: "/companies", - }, - current: { - href: "/companies?page=1&pageSize=10", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | -| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | +# Links + +## Example Usage + +```typescript +import { Links } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Links = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `self` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `current` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_check_mark: | N/A | +| `next` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | | `previous` | [shared.HalRef](../../../sdk/models/shared/halref.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/mappingoptions.md b/sync-for-expenses/docs/sdk/models/shared/mappingoptions.md index ac6605cbc..77e0337dc 100644 --- a/sync-for-expenses/docs/sdk/models/shared/mappingoptions.md +++ b/sync-for-expenses/docs/sdk/models/shared/mappingoptions.md @@ -1,44 +1,20 @@ -# MappingOptions - -## Example Usage - -```typescript -import { MappingOptions } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: MappingOptions = { - expenseProvider: "Partner Expense", - accounts: [ - { - id: "127f3b99-8dc2-4b7e-854c-91ef9bd2757b", - nominalCode: "300", - name: "Purchases", - currency: "GBP", - accountType: "Expense", - fullyQualifiedCategory: "Expense.DirectCosts", - validTransactionTypes: [ - "Payment", - ], - validFor: [ - "expense-transactions.Payment", - ], - }, - ], - trackingCategories: [ - { - id: "DEPARTMENT_2", - name: "New York", - parentId: "DEPARTMENTS", - }, - ], - taxRates: null, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `expenseProvider` | *string* | :heavy_minus_sign: | Name of the expense integration. | Partner Expense | -| `accounts` | [shared.AccountMappingInfo](../../../sdk/models/shared/accountmappinginfo.md)[] | :heavy_minus_sign: | Array of available accounts for mapping. | | -| `trackingCategories` | [shared.TrackingCategoryMappingInfo](../../../sdk/models/shared/trackingcategorymappinginfo.md)[] | :heavy_minus_sign: | Array of available tracking categories for mapping. | | +# MappingOptions + +## Example Usage + +```typescript +import { MappingOptions } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: MappingOptions = { + expenseProvider: "Partner Expense", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | +| `expenseProvider` | *string* | :heavy_minus_sign: | Name of the expense integration. | Partner Expense | +| `accounts` | [shared.AccountMappingInfo](../../../sdk/models/shared/accountmappinginfo.md)[] | :heavy_minus_sign: | Array of available accounts for mapping. | | +| `trackingCategories` | [shared.TrackingCategoryMappingInfo](../../../sdk/models/shared/trackingcategorymappinginfo.md)[] | :heavy_minus_sign: | Array of available tracking categories for mapping. | | | `taxRates` | [shared.TaxRateMappingInfo](../../../sdk/models/shared/taxratemappinginfo.md)[] | :heavy_minus_sign: | Array of available tax rates for mapping. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/metadata.md b/sync-for-expenses/docs/sdk/models/shared/metadata.md index 3bef2fb29..038f33448 100644 --- a/sync-for-expenses/docs/sdk/models/shared/metadata.md +++ b/sync-for-expenses/docs/sdk/models/shared/metadata.md @@ -1,15 +1,15 @@ -# Metadata - -## Example Usage - -```typescript -import { Metadata } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Metadata = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | +# Metadata + +## Example Usage + +```typescript +import { Metadata } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Metadata = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- | | `isDeleted` | *boolean* | :heavy_minus_sign: | Indicates whether the record has been deleted in the third-party system this record originated from. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/phone.md b/sync-for-expenses/docs/sdk/models/shared/phone.md index 0a84604d8..8a8e47aae 100644 --- a/sync-for-expenses/docs/sdk/models/shared/phone.md +++ b/sync-for-expenses/docs/sdk/models/shared/phone.md @@ -1,19 +1,16 @@ -# Phone - -## Example Usage - -```typescript -import { Phone } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Phone = { - number: "+44 25691 154789", - type: "Unknown", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | -| `number` | *string* | :heavy_minus_sign: | A phone number. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | -| `type` | [shared.CompanyInformationPhoneNumbersType](../../../sdk/models/shared/companyinformationphonenumberstype.md) | :heavy_check_mark: | The type of phone number | | \ No newline at end of file +# Phone + +## Example Usage + +```typescript +import { Phone } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Phone = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `number` | *string* | :heavy_minus_sign: | A phone number. | +| `type` | [shared.CompanyInformationPhoneNumbersType](../../../sdk/models/shared/companyinformationphonenumberstype.md) | :heavy_check_mark: | The type of phone number | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/phonenumberitems.md b/sync-for-expenses/docs/sdk/models/shared/phonenumberitems.md index b1cb36981..2a0ef70f8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/phonenumberitems.md +++ b/sync-for-expenses/docs/sdk/models/shared/phonenumberitems.md @@ -1,19 +1,19 @@ -# PhoneNumberItems - -## Example Usage - -```typescript -import { PhoneNumberItems } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PhoneNumberItems = { - number: "+44 25691 154789", - type: "Primary", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -| `number` | *string* | :heavy_minus_sign: | A phone number. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +# PhoneNumberItems + +## Example Usage + +```typescript +import { PhoneNumberItems } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PhoneNumberItems = { + number: "+44 25691 154789", + type: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- | +| `number` | *string* | :heavy_minus_sign: | A phone number. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | | `type` | [shared.ItemsType](../../../sdk/models/shared/itemstype.md) | :heavy_check_mark: | The type of phone number | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/propertiedatatype.md b/sync-for-expenses/docs/sdk/models/shared/propertiedatatype.md index ad3472a4f..79a17b27a 100644 --- a/sync-for-expenses/docs/sdk/models/shared/propertiedatatype.md +++ b/sync-for-expenses/docs/sdk/models/shared/propertiedatatype.md @@ -1,17 +1,15 @@ -# PropertieDataType - -Available data types - -## Example Usage - -```typescript -import { PropertieDataType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PropertieDataType = "invoices"; -``` - -## Values - -```typescript -"accountTransactions" | "balanceSheet" | "bankAccounts" | "bankTransactions" | "billCreditNotes" | "billPayments" | "bills" | "cashFlowStatement" | "chartOfAccounts" | "company" | "creditNotes" | "customers" | "directCosts" | "directIncomes" | "invoices" | "itemReceipts" | "items" | "journalEntries" | "journals" | "paymentMethods" | "payments" | "profitAndLoss" | "purchaseOrders" | "salesOrders" | "suppliers" | "taxRates" | "trackingCategories" | "transfers" | "banking-accountBalances" | "banking-accounts" | "banking-transactionCategories" | "banking-transactions" | "commerce-companyInfo" | "commerce-customers" | "commerce-disputes" | "commerce-locations" | "commerce-orders" | "commerce-paymentMethods" | "commerce-payments" | "commerce-productCategories" | "commerce-products" | "commerce-taxComponents" | "commerce-transactions" +# PropertieDataType + +## Example Usage + +```typescript +import { PropertieDataType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PropertieDataType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pulloperation.md b/sync-for-expenses/docs/sdk/models/shared/pulloperation.md index e5e1041df..4d4830be7 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pulloperation.md +++ b/sync-for-expenses/docs/sdk/models/shared/pulloperation.md @@ -1,40 +1,40 @@ -# PullOperation - -Information about a queued, in progress or completed pull operation. -*Formally called `dataset`* - -## Example Usage - -```typescript -import { PullOperation } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PullOperation = { - 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, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier of the company associated to this pull operation. | 22ece347-e5f6-4896-95e0-35a4c7f17023 | -| `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. | | -| `status` | [shared.DatasetStatus](../../../sdk/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 | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `progress` | *number* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | -| `isCompleted` | *boolean* | :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` | *boolean* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | \ No newline at end of file +# PullOperation + +Information about a queued, in progress or completed pull operation. +*Formally called `dataset`* + +## Example Usage + +```typescript +import { PullOperation } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PullOperation = { + 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, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Unique identifier of the pull operation. | 943accd0-4247-42d8-865b-363c8629e1da | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier of the company associated to this pull operation. | 22ece347-e5f6-4896-95e0-35a4c7f17023 | +| `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. | | +| `status` | [shared.DatasetStatus](../../../sdk/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 | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about a transient or persistent error returned by Codat or the source platform. | | +| `requested` | *string* | :heavy_check_mark: | Date of the transfer transaction as recorded in the accounting software. | | +| `completed` | *string* | :heavy_minus_sign: | Date of the transfer transaction as recorded in the accounting software. | | +| `progress` | *number* | :heavy_check_mark: | An integer signifying the progress of the pull operation. | | +| `isCompleted` | *boolean* | :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` | *boolean* | :heavy_check_mark: | `True` if the pull operation entered an error state. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pulloperations.md b/sync-for-expenses/docs/sdk/models/shared/pulloperations.md index 86e3f36f1..3024be4de 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pulloperations.md +++ b/sync-for-expenses/docs/sdk/models/shared/pulloperations.md @@ -1,31 +1,23 @@ -# PullOperations - -## Example Usage - -```typescript -import { PullOperations } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PullOperations = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.PullOperation](../../../sdk/models/shared/pulloperation.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# PullOperations + +## Example Usage + +```typescript +import { PullOperations } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PullOperations = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.PullOperation](../../../sdk/models/shared/pulloperation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushchangetype.md b/sync-for-expenses/docs/sdk/models/shared/pushchangetype.md index 8da3b1788..a82fd44fc 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushchangetype.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushchangetype.md @@ -1,17 +1,17 @@ -# PushChangeType - -Type of change being applied to record in third party platform. - -## Example Usage - -```typescript -import { PushChangeType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushChangeType = "Created"; -``` - -## Values - -```typescript -"Unknown" | "Created" | "Modified" | "Deleted" | "AttachmentUploaded" +# PushChangeType + +Type of change being applied to record in third party platform. + +## Example Usage + +```typescript +import { PushChangeType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushChangeType = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Created" | "Modified" | "Deleted" | "AttachmentUploaded" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushfieldvalidation.md b/sync-for-expenses/docs/sdk/models/shared/pushfieldvalidation.md index 92276f33c..64931985c 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushfieldvalidation.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushfieldvalidation.md @@ -1,19 +1,19 @@ -# PushFieldValidation - -## Example Usage - -```typescript -import { PushFieldValidation } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushFieldValidation = { - details: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | -| `field` | *string* | :heavy_minus_sign: | Field name that resulted in the validation issue. | -| `details` | *string* | :heavy_check_mark: | Details on the validation issue. | +# PushFieldValidation + +## Example Usage + +```typescript +import { PushFieldValidation } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushFieldValidation = { + details: "string", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | ----------------------------------------------------- | +| `field` | *string* | :heavy_minus_sign: | Field name that resulted in the validation issue. | +| `details` | *string* | :heavy_check_mark: | Details on the validation issue. | | `ref` | *string* | :heavy_minus_sign: | Unique reference identifier for the validation issue. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoperation.md b/sync-for-expenses/docs/sdk/models/shared/pushoperation.md index 6acec032a..d4de140b7 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoperation.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoperation.md @@ -1,37 +1,35 @@ -# PushOperation - -## Example Usage - -```typescript -import { PushOperation } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOperation = { - changes: null, - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "9c39f707-db6c-421b-b270-d82fde811810", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Failed", - statusCode: 143409, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# PushOperation + +## Example Usage + +```typescript +import { PushOperation } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOperation = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoperationchange.md b/sync-for-expenses/docs/sdk/models/shared/pushoperationchange.md index 2e005605a..bb97744de 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoperationchange.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoperationchange.md @@ -1,21 +1,17 @@ -# PushOperationChange - -## Example Usage - -```typescript -import { PushOperationChange } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOperationChange = { - recordRef: { - dataType: "invoices", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | -| `type` | [shared.PushChangeType](../../../sdk/models/shared/pushchangetype.md) | :heavy_minus_sign: | Type of change being applied to record in third party platform. | -| `recordRef` | [shared.PushOperationRef](../../../sdk/models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | +# PushOperationChange + +## Example Usage + +```typescript +import { PushOperationChange } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOperationChange = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | +| `type` | [shared.PushChangeType](../../../sdk/models/shared/pushchangetype.md) | :heavy_minus_sign: | N/A | +| `recordRef` | [shared.PushOperationRef](../../../sdk/models/shared/pushoperationref.md) | :heavy_minus_sign: | N/A | | `attachmentId` | *string* | :heavy_minus_sign: | Unique identifier for the attachment created otherwise null. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoperationref.md b/sync-for-expenses/docs/sdk/models/shared/pushoperationref.md index fd9b5005f..1fa4d2485 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoperationref.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoperationref.md @@ -1,18 +1,16 @@ -# PushOperationRef - -## Example Usage - -```typescript -import { PushOperationRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOperationRef = { - dataType: "invoices", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | \ No newline at end of file +# PushOperationRef + +## Example Usage + +```typescript +import { PushOperationRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOperationRef = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | --------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier for a push operation. | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoperations.md b/sync-for-expenses/docs/sdk/models/shared/pushoperations.md index 46c771d73..8c532c2ea 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoperations.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoperations.md @@ -1,31 +1,23 @@ -# PushOperations - -## Example Usage - -```typescript -import { PushOperations } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOperations = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.PushOperation](../../../sdk/models/shared/pushoperation.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# PushOperations + +## Example Usage + +```typescript +import { PushOperations } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOperations = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.PushOperation](../../../sdk/models/shared/pushoperation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoperationstatus.md b/sync-for-expenses/docs/sdk/models/shared/pushoperationstatus.md index 6ccddbb04..d04fd2dc4 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoperationstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoperationstatus.md @@ -1,17 +1,17 @@ -# PushOperationStatus - -The current status of the push operation. - -## Example Usage - -```typescript -import { PushOperationStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOperationStatus = "Failed"; -``` - -## Values - -```typescript -"Pending" | "Failed" | "Success" | "TimedOut" +# PushOperationStatus + +The current status of the push operation. + +## Example Usage + +```typescript +import { PushOperationStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOperationStatus = "Pending"; +``` + +## Values + +```typescript +"Pending" | "Failed" | "Success" | "TimedOut" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoption.md b/sync-for-expenses/docs/sdk/models/shared/pushoption.md index a450a2463..593af9c04 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoption.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoption.md @@ -1,25 +1,25 @@ -# PushOption - -## Example Usage - -```typescript -import { PushOption } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOption = { - type: "MultiPart", - displayName: "Travis.Ebert-Fahey", - required: false, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | -| `displayName` | *string* | :heavy_check_mark: | The property's display name. | -| `description` | *string* | :heavy_minus_sign: | A description of the property. | -| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | -| `properties` | Record | :heavy_minus_sign: | N/A | -| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | +# PushOption + +## Example Usage + +```typescript +import { PushOption } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOption = { + type: "string", + displayName: "string", + required: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `displayName` | *string* | :heavy_check_mark: | The property's display name. | +| `description` | *string* | :heavy_minus_sign: | A description of the property. | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `properties` | Record | :heavy_minus_sign: | N/A | +| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | | `validation` | [shared.PushValidationInfo](../../../sdk/models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoptionchoice.md b/sync-for-expenses/docs/sdk/models/shared/pushoptionchoice.md index caa4e330c..58e7af3e0 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoptionchoice.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoptionchoice.md @@ -1,19 +1,19 @@ -# PushOptionChoice - -## Example Usage - -```typescript -import { PushOptionChoice } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOptionChoice = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | -| `value` | *string* | :heavy_minus_sign: | Allowed value for field. | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | -| `displayName` | *string* | :heavy_minus_sign: | The property's display name. | -| `description` | *string* | :heavy_minus_sign: | A description of the property. | +# PushOptionChoice + +## Example Usage + +```typescript +import { PushOptionChoice } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOptionChoice = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | --------------------------------------------------------------------- | +| `value` | *string* | :heavy_minus_sign: | Allowed value for field. | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_minus_sign: | The option type. | +| `displayName` | *string* | :heavy_minus_sign: | The property's display name. | +| `description` | *string* | :heavy_minus_sign: | A description of the property. | | `required` | *boolean* | :heavy_minus_sign: | The property is required if `True`. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoptionproperty.md b/sync-for-expenses/docs/sdk/models/shared/pushoptionproperty.md index 6595312ab..6eff78a96 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoptionproperty.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoptionproperty.md @@ -1,27 +1,26 @@ -# PushOptionProperty - -## Example Usage - -```typescript -import { PushOptionProperty } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOptionProperty = { - type: "Array", - displayName: "Fannie10", - description: - "sonar very sympathetically notwithstanding alarmed modulo grizzled", - required: true, -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | -| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | -| `displayName` | *string* | :heavy_check_mark: | The property's display name. | -| `description` | *string* | :heavy_check_mark: | A description of the property. | -| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | -| `properties` | Record | :heavy_minus_sign: | N/A | -| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | +# PushOptionProperty + +## Example Usage + +```typescript +import { PushOptionProperty } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOptionProperty = { + type: "string", + displayName: "string", + description: "string", + required: false, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------- | +| `type` | [shared.PushOptionType](../../../sdk/models/shared/pushoptiontype.md) | :heavy_check_mark: | The option type. | +| `displayName` | *string* | :heavy_check_mark: | The property's display name. | +| `description` | *string* | :heavy_check_mark: | A description of the property. | +| `required` | *boolean* | :heavy_check_mark: | The property is required if `True`. | +| `properties` | Record | :heavy_minus_sign: | N/A | +| `options` | [shared.PushOptionChoice](../../../sdk/models/shared/pushoptionchoice.md)[] | :heavy_minus_sign: | N/A | | `validation` | [shared.PushValidationInfo](../../../sdk/models/shared/pushvalidationinfo.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushoptiontype.md b/sync-for-expenses/docs/sdk/models/shared/pushoptiontype.md index 0d88fa194..2a6a558e7 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushoptiontype.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushoptiontype.md @@ -1,17 +1,17 @@ -# PushOptionType - -The option type. - -## Example Usage - -```typescript -import { PushOptionType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushOptionType = "DateTime"; -``` - -## Values - -```typescript -"Array" | "Object" | "String" | "Number" | "Boolean" | "DateTime" | "File" | "MultiPart" +# PushOptionType + +The option type. + +## Example Usage + +```typescript +import { PushOptionType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushOptionType = "Array"; +``` + +## Values + +```typescript +"Array" | "Object" | "String" | "Number" | "Boolean" | "DateTime" | "File" | "MultiPart" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/pushvalidationinfo.md b/sync-for-expenses/docs/sdk/models/shared/pushvalidationinfo.md index 0f083ff27..831e0b0f3 100644 --- a/sync-for-expenses/docs/sdk/models/shared/pushvalidationinfo.md +++ b/sync-for-expenses/docs/sdk/models/shared/pushvalidationinfo.md @@ -1,16 +1,16 @@ -# PushValidationInfo - -## Example Usage - -```typescript -import { PushValidationInfo } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: PushValidationInfo = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | -| `warnings` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | +# PushValidationInfo + +## Example Usage + +```typescript +import { PushValidationInfo } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: PushValidationInfo = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- | +| `warnings` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | | `information` | [shared.PushFieldValidation](../../../sdk/models/shared/pushfieldvalidation.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/recordref.md b/sync-for-expenses/docs/sdk/models/shared/recordref.md index 5d8883827..0c955461a 100644 --- a/sync-for-expenses/docs/sdk/models/shared/recordref.md +++ b/sync-for-expenses/docs/sdk/models/shared/recordref.md @@ -1,17 +1,17 @@ -# RecordRef - -## Example Usage - -```typescript -import { RecordRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: RecordRef = { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | +# RecordRef + +## Example Usage + +```typescript +import { RecordRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: RecordRef = { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | ---------------------------------------------------- | | `id` | *string* | :heavy_minus_sign: | Identifier of linked reference from mapping options. | 40e3e57c-2322-4898-966c-ca41adfd23fd | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransaction.md b/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransaction.md index ec64c9002..52abb3ce9 100644 --- a/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransaction.md +++ b/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransaction.md @@ -1,62 +1,33 @@ -# ReimbursableExpenseTransaction - -## Example Usage - -```typescript -import { ReimbursableExpenseTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: ReimbursableExpenseTransaction = { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: { - id: "8000004C-1724173136", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | -| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | -| `contactRef` | [shared.ReimbursementContactRef](../../../sdk/models/shared/reimbursementcontactref.md) | :heavy_check_mark: | N/A | | -| `apAccountRef` | [shared.ApAccountRef](../../../sdk/models/shared/apaccountref.md) | :heavy_minus_sign: | N/A | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dueDate` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | -| `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +# ReimbursableExpenseTransaction + +## Example Usage + +```typescript +import { ReimbursableExpenseTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ReimbursableExpenseTransaction = { + id: "4d7c6929-7770-412b-91bb-44d3bc71d111", + contactRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + issueDate: "string", + dueDate: "string", + currency: "GBP", + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_check_mark: | Your unique identifier for the transaction. | 4d7c6929-7770-412b-91bb-44d3bc71d111 | +| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | +| `contactRef` | [shared.ReimbursementContactRef](../../../sdk/models/shared/reimbursementcontactref.md) | :heavy_check_mark: | N/A | | +| `apAccountRef` | [shared.ApAccountRef](../../../sdk/models/shared/apaccountref.md) | :heavy_minus_sign: | N/A | | +| `issueDate` | *string* | :heavy_check_mark: | Date of the transaction was recorded. | | +| `dueDate` | *string* | :heavy_check_mark: | Date the supplier is due to be paid. | | +| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `currencyRate` | *Decimal | number* | :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. \| | | +| `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | | `lines` | [shared.ReimbursableExpenseTransactionLine](../../../sdk/models/shared/reimbursableexpensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransactionline.md b/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransactionline.md index 19c0bf57f..a2d4a94b5 100644 --- a/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransactionline.md +++ b/sync-for-expenses/docs/sdk/models/shared/reimbursableexpensetransactionline.md @@ -1,43 +1,26 @@ -# ReimbursableExpenseTransactionLine - -## Example Usage - -```typescript -import { ReimbursableExpenseTransactionLine } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: ReimbursableExpenseTransactionLine = { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: null, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `description` | *string* | :heavy_minus_sign: | line description | 2-night hotel stay | -| `netAmount` | *Decimal* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 100 | -| `taxAmount` | *Decimal* | :heavy_minus_sign: | Amount of tax for the line. | 20 | -| `taxRateRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | N/A | | -| `accountRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | N/A | | -| `itemRef` | [shared.ItemRef](../../../sdk/models/shared/itemref.md) | :heavy_minus_sign: | N/A | | -| `trackingRefs` | [shared.TrackingRef](../../../sdk/models/shared/trackingref.md)[] | :heavy_minus_sign: | N/A | | -| `invoiceTo` | [shared.InvoiceTo](../../../sdk/models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | \ No newline at end of file +# ReimbursableExpenseTransactionLine + +## Example Usage + +```typescript +import { ReimbursableExpenseTransactionLine } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ReimbursableExpenseTransactionLine = { + description: "2-night hotel stay", + netAmount: 100, + taxAmount: 20, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `description` | *string* | :heavy_minus_sign: | line description | 2-night hotel stay | +| `netAmount` | *Decimal | number* | :heavy_check_mark: | Amount of the line, exclusive of tax. | 100 | +| `taxAmount` | *Decimal | number* | :heavy_minus_sign: | Amount of tax for the line. | 20 | +| `taxRateRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | N/A | | +| `accountRef` | [shared.RecordRef](../../../sdk/models/shared/recordref.md) | :heavy_minus_sign: | The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. | | +| `itemRef` | [shared.ItemRef](../../../sdk/models/shared/itemref.md) | :heavy_minus_sign: | N/A | | +| `trackingRefs` | [shared.TrackingRef](../../../sdk/models/shared/trackingref.md)[] | :heavy_minus_sign: | N/A | | +| `invoiceTo` | [shared.InvoiceTo](../../../sdk/models/shared/invoiceto.md) | :heavy_minus_sign: | Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/reimbursementcontactref.md b/sync-for-expenses/docs/sdk/models/shared/reimbursementcontactref.md index 8b0335819..74aa5fb14 100644 --- a/sync-for-expenses/docs/sdk/models/shared/reimbursementcontactref.md +++ b/sync-for-expenses/docs/sdk/models/shared/reimbursementcontactref.md @@ -1,17 +1,17 @@ -# ReimbursementContactRef - -## Example Usage - -```typescript -import { ReimbursementContactRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ReimbursementContactRef = { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# ReimbursementContactRef + +## Example Usage + +```typescript +import { ReimbursementContactRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ReimbursementContactRef = { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `id` | *string* | :heavy_check_mark: | Identifier of contact. | 40e3e57c-2322-4898-966c-ca41adfd23fd | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/security.md b/sync-for-expenses/docs/sdk/models/shared/security.md index 6d43c5722..f53adb039 100644 --- a/sync-for-expenses/docs/sdk/models/shared/security.md +++ b/sync-for-expenses/docs/sdk/models/shared/security.md @@ -1,17 +1,15 @@ -# Security - -## Example Usage - -```typescript -import { Security } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Security = { - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | ------------------------------ | -| `authHeader` | *string* | :heavy_check_mark: | N/A | Basic BASE_64_ENCODED(API_KEY) | \ No newline at end of file +# Security + +## Example Usage + +```typescript +import { Security } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Security = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------ | ------------------ | ------------------ | ------------------ | +| `authHeader` | *string* | :heavy_check_mark: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/sourcetype.md b/sync-for-expenses/docs/sdk/models/shared/sourcetype.md index 2a5853885..f59c7a782 100644 --- a/sync-for-expenses/docs/sdk/models/shared/sourcetype.md +++ b/sync-for-expenses/docs/sdk/models/shared/sourcetype.md @@ -1,17 +1,17 @@ -# SourceType - -The type of platform of the connection. - -## Example Usage - -```typescript -import { SourceType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: SourceType = "Accounting"; -``` - -## Values - -```typescript -"Accounting" | "Banking" | "BankFeed" | "Commerce" | "Expense" | "Other" | "Unknown" +# SourceType + +The type of platform of the connection. + +## Example Usage + +```typescript +import { SourceType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: SourceType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/status.md b/sync-for-expenses/docs/sdk/models/shared/status.md index 4fbf01b43..1c86441fc 100644 --- a/sync-for-expenses/docs/sdk/models/shared/status.md +++ b/sync-for-expenses/docs/sdk/models/shared/status.md @@ -1,17 +1,17 @@ -# Status - -The current status of the dataset. - -## Example Usage - -```typescript -import { Status } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Status = "Validating"; -``` - -## Values - -```typescript -"Initial" | "Queued" | "Fetching" | "MapQueued" | "Mapping" | "Complete" | "FetchError" | "MapError" | "InternalError" | "ProcessingQueued" | "Processing" | "ProcessingError" | "ValidationQueued" | "Validating" | "ValidationError" | "AuthError" | "Cancelled" | "NotSupported" | "RateLimitError" | "PermissionsError" | "PrerequisiteNotMet" +# Status + +The current status of the dataset. + +## Example Usage + +```typescript +import { Status } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Status = "Initial"; +``` + +## Values + +```typescript +"Initial" | "Queued" | "Fetching" | "MapQueued" | "Mapping" | "Complete" | "FetchError" | "MapError" | "InternalError" | "ProcessingQueued" | "Processing" | "ProcessingError" | "ValidationQueued" | "Validating" | "ValidationError" | "AuthError" | "Cancelled" | "NotSupported" | "RateLimitError" | "PermissionsError" | "PrerequisiteNotMet" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/supplementaldata.md b/sync-for-expenses/docs/sdk/models/shared/supplementaldata.md index 7455ae71a..510cb7e1b 100644 --- a/sync-for-expenses/docs/sdk/models/shared/supplementaldata.md +++ b/sync-for-expenses/docs/sdk/models/shared/supplementaldata.md @@ -1,19 +1,19 @@ -# SupplementalData - -Supplemental data is additional data you can include in our standard data types. - -It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. - -## Example Usage - -```typescript -import { SupplementalData } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: SupplementalData = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | +# SupplementalData + +Supplemental data is additional data you can include in our standard data types. + +It is referenced as a configured dynamic key value pair that is unique to the accounting software. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. + +## Example Usage + +```typescript +import { SupplementalData } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: SupplementalData = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------- | ------------------------------------- | ------------------------------------- | ------------------------------------- | | `content` | Record> | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/supplier.md b/sync-for-expenses/docs/sdk/models/shared/supplier.md index 31b15ef0c..26d39cc83 100644 --- a/sync-for-expenses/docs/sdk/models/shared/supplier.md +++ b/sync-for-expenses/docs/sdk/models/shared/supplier.md @@ -1,69 +1,70 @@ -# Supplier - -## Overview - -From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - -## Example Usage - -```typescript -import { Supplier } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Supplier = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | -| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | -| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `registrationNumber` | *string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Supplier's company tax number. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | +# Supplier + +## Overview + +From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + +## Example Usage + +```typescript +import { Supplier } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Supplier = { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | +| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | +| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | +| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | +| `registrationNumber` | *string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | +| `taxNumber` | *string* | :heavy_minus_sign: | Supplier's company tax number. | | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | +| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | | `supplementalData` | [shared.SupplementalData](../../../sdk/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/sync-for-expenses/docs/sdk/models/shared/supplierdetails.md b/sync-for-expenses/docs/sdk/models/shared/supplierdetails.md index 796fce9ed..44a6f297d 100644 --- a/sync-for-expenses/docs/sdk/models/shared/supplierdetails.md +++ b/sync-for-expenses/docs/sdk/models/shared/supplierdetails.md @@ -1,15 +1,15 @@ -# SupplierDetails - -## Example Usage - -```typescript -import { SupplierDetails } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: SupplierDetails = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | +# SupplierDetails + +## Example Usage + +```typescript +import { SupplierDetails } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: SupplierDetails = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ | | `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/suppliers.md b/sync-for-expenses/docs/sdk/models/shared/suppliers.md index fc5802749..cbbae8904 100644 --- a/sync-for-expenses/docs/sdk/models/shared/suppliers.md +++ b/sync-for-expenses/docs/sdk/models/shared/suppliers.md @@ -1,31 +1,23 @@ -# Suppliers - -## Example Usage - -```typescript -import { Suppliers } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Suppliers = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Supplier](../../../sdk/models/shared/supplier.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Suppliers + +## Example Usage + +```typescript +import { Suppliers } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Suppliers = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | ----------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Supplier](../../../sdk/models/shared/supplier.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/supplierstatus.md b/sync-for-expenses/docs/sdk/models/shared/supplierstatus.md index bae8b941d..67578de97 100644 --- a/sync-for-expenses/docs/sdk/models/shared/supplierstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/supplierstatus.md @@ -1,17 +1,17 @@ -# SupplierStatus - -Status of the supplier. - -## Example Usage - -```typescript -import { SupplierStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: SupplierStatus = "Archived"; -``` - -## Values - -```typescript -"Unknown" | "Active" | "Archived" +# SupplierStatus + +Status of the supplier. + +## Example Usage + +```typescript +import { SupplierStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: SupplierStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Active" | "Archived" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/taxratemappinginfo.md b/sync-for-expenses/docs/sdk/models/shared/taxratemappinginfo.md index 25cab7e7f..96a125e8a 100644 --- a/sync-for-expenses/docs/sdk/models/shared/taxratemappinginfo.md +++ b/sync-for-expenses/docs/sdk/models/shared/taxratemappinginfo.md @@ -1,30 +1,26 @@ -# TaxRateMappingInfo - -## Example Usage - -```typescript -import { TaxRateMappingInfo } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: TaxRateMappingInfo = { - id: "23_Bills", - name: "20% Bill tax Bills", - code: "20% Bill tax", - effectiveTaxRate: new Decimal("20"), - totalTaxRate: new Decimal("20"), - validTransactionTypes: [ - "Payment", - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of tax rate. | 23_Bills | -| `name` | *string* | :heavy_minus_sign: | Name of the tax rate in the accounting software. | 20% Bill tax Bills | -| `code` | *string* | :heavy_minus_sign: | Code for the tax rate from the accounting software. | 20% Bill tax | -| `effectiveTaxRate` | *Decimal* | :heavy_minus_sign: | Effective tax rate. | 20 | -| `totalTaxRate` | *Decimal* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | 20 | +# TaxRateMappingInfo + +## Example Usage + +```typescript +import { TaxRateMappingInfo } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TaxRateMappingInfo = { + id: "23_Bills", + name: "20% Bill tax Bills", + code: "20% Bill tax", + effectiveTaxRate: 20, + totalTaxRate: 20, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of tax rate. | 23_Bills | +| `name` | *string* | :heavy_minus_sign: | Name of the tax rate in the accounting software. | 20% Bill tax Bills | +| `code` | *string* | :heavy_minus_sign: | Code for the tax rate from the accounting software. | 20% Bill tax | +| `effectiveTaxRate` | *Decimal | number* | :heavy_minus_sign: | Effective tax rate. | 20 | +| `totalTaxRate` | *Decimal | number* | :heavy_minus_sign: | Total (not compounded) sum of the components of a tax rate. | 20 | | `validTransactionTypes` | [shared.ValidTransactionTypes](../../../sdk/models/shared/validtransactiontypes.md)[] | :heavy_minus_sign: | Supported transaction types for the account. | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/to.md b/sync-for-expenses/docs/sdk/models/shared/to.md index be0c84690..358cf5ca8 100644 --- a/sync-for-expenses/docs/sdk/models/shared/to.md +++ b/sync-for-expenses/docs/sdk/models/shared/to.md @@ -1,22 +1,16 @@ -# To - -## Example Usage - -```typescript -import { To } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: To = { - accountRef: { - id: "", - }, - amount: new Decimal("512.02"), -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | -| `accountRef` | [shared.TransferTransactionRequestAccountReference](../../../sdk/models/shared/transfertransactionrequestaccountreference.md) | :heavy_check_mark: | Reference of the account you are transferring money to. | -| `amount` | *Decimal* | :heavy_check_mark: | Amount that has been transferred to the account in the native currency of the account. | \ No newline at end of file +# To + +## Example Usage + +```typescript +import { To } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: To = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------- | +| `accountRef` | *TransferTransactionRequestAccountReference* | :heavy_check_mark: | N/A | +| `amount` | *Decimal | number* | :heavy_check_mark: | Amount that has been transferred to the account in the native currency of the account. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/trackingcategorymappinginfo.md b/sync-for-expenses/docs/sdk/models/shared/trackingcategorymappinginfo.md index 8cee33eb1..2d1d0a4dc 100644 --- a/sync-for-expenses/docs/sdk/models/shared/trackingcategorymappinginfo.md +++ b/sync-for-expenses/docs/sdk/models/shared/trackingcategorymappinginfo.md @@ -1,22 +1,22 @@ -# TrackingCategoryMappingInfo - -## Example Usage - -```typescript -import { TrackingCategoryMappingInfo } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TrackingCategoryMappingInfo = { - id: "DEPARTMENT_2", - name: "New York", - parentId: "DEPARTMENTS", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the tracking category. | DEPARTMENT_2 | -| `name` | *string* | :heavy_minus_sign: | Name of the tracking category as it appears in the accounting software. | New York | -| `hasChildren` | *boolean* | :heavy_minus_sign: | Boolean of whether the tracking category has child categories. | | +# TrackingCategoryMappingInfo + +## Example Usage + +```typescript +import { TrackingCategoryMappingInfo } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TrackingCategoryMappingInfo = { + id: "DEPARTMENT_2", + name: "New York", + parentId: "DEPARTMENTS", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the tracking category. | DEPARTMENT_2 | +| `name` | *string* | :heavy_minus_sign: | Name of the tracking category as it appears in the accounting software. | New York | +| `hasChildren` | *boolean* | :heavy_minus_sign: | Boolean of whether the tracking category has child categories. | | | `parentId` | *string* | :heavy_minus_sign: | ID of the parent tracking category | DEPARTMENTS | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/trackingref.md b/sync-for-expenses/docs/sdk/models/shared/trackingref.md index 0b7429518..87ef08667 100644 --- a/sync-for-expenses/docs/sdk/models/shared/trackingref.md +++ b/sync-for-expenses/docs/sdk/models/shared/trackingref.md @@ -1,18 +1,19 @@ -# TrackingRef - -## Example Usage - -```typescript -import { TrackingRef } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TrackingRef = { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | +# TrackingRef + +## Example Usage + +```typescript +import { TrackingRef } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TrackingRef = { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | | `dataType` | [shared.TrackingRefDataType](../../../sdk/models/shared/trackingrefdatatype.md) | :heavy_minus_sign: | The type of the linked reference | trackingCategories | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransaction.md b/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransaction.md index 085c0d045..443868b02 100644 --- a/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransaction.md +++ b/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransaction.md @@ -1,18 +1,19 @@ -# TrackingRefAdjustmentTransaction - -## Example Usage - -```typescript -import { TrackingRefAdjustmentTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TrackingRefAdjustmentTransaction = { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | -| `id` | *string* | :heavy_minus_sign: | Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | +# TrackingRefAdjustmentTransaction + +## Example Usage + +```typescript +import { TrackingRefAdjustmentTransaction } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TrackingRefAdjustmentTransaction = { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier. | e9a1b63d-9ff0-40e7-8038-016354b987e6 | | `dataType` | [shared.TrackingRefAdjustmentTransactionDataType](../../../sdk/models/shared/trackingrefadjustmenttransactiondatatype.md) | :heavy_minus_sign: | The type of the linked reference | trackingCategories | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransactiondatatype.md b/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransactiondatatype.md index fe7e0c69b..10d118d9a 100644 --- a/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransactiondatatype.md +++ b/sync-for-expenses/docs/sdk/models/shared/trackingrefadjustmenttransactiondatatype.md @@ -1,17 +1,15 @@ -# TrackingRefAdjustmentTransactionDataType - -The type of the linked reference - -## Example Usage - -```typescript -import { TrackingRefAdjustmentTransactionDataType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TrackingRefAdjustmentTransactionDataType = "trackingCategories"; -``` - -## Values - -```typescript -"trackingCategories" | "customers" | "suppliers" +# TrackingRefAdjustmentTransactionDataType + +## Example Usage + +```typescript +import { TrackingRefAdjustmentTransactionDataType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TrackingRefAdjustmentTransactionDataType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/trackingrefdatatype.md b/sync-for-expenses/docs/sdk/models/shared/trackingrefdatatype.md index 0b507a10a..431742215 100644 --- a/sync-for-expenses/docs/sdk/models/shared/trackingrefdatatype.md +++ b/sync-for-expenses/docs/sdk/models/shared/trackingrefdatatype.md @@ -1,17 +1,15 @@ -# TrackingRefDataType - -The type of the linked reference - -## Example Usage - -```typescript -import { TrackingRefDataType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TrackingRefDataType = "trackingCategories"; -``` - -## Values - -```typescript -"trackingCategories" | "customers" +# TrackingRefDataType + +## Example Usage + +```typescript +import { TrackingRefDataType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TrackingRefDataType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transaction.md b/sync-for-expenses/docs/sdk/models/shared/transaction.md index eef052c21..5a4c5fc50 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transaction.md +++ b/sync-for-expenses/docs/sdk/models/shared/transaction.md @@ -1,21 +1,22 @@ -# Transaction - -## Example Usage - -```typescript -import { Transaction } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Transaction = { - transactionId: "aa02271d-ed5f-47f5-be76-778d5905225a", - status: "Completed", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | -| `transactionId` | *string* | :heavy_minus_sign: | Your unique idenfier of the transaction. | aa02271d-ed5f-47f5-be76-778d5905225a | -| `status` | [shared.TransactionStatus](../../../sdk/models/shared/transactionstatus.md) | :heavy_minus_sign: | Status of the transaction. | Completed | -| `message` | *string* | :heavy_minus_sign: | Metadata such as validation errors or the resulting record created in the accounting software. | | +# Transaction + +## Example Usage + +```typescript +import { Transaction } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Transaction = { + transactionId: "aa02271d-ed5f-47f5-be76-778d5905225a", + status: "Completed", + integrationType: "expenses", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | +| `transactionId` | *string* | :heavy_minus_sign: | Your unique idenfier of the transaction. | aa02271d-ed5f-47f5-be76-778d5905225a | +| `status` | [shared.TransactionStatus](../../../sdk/models/shared/transactionstatus.md) | :heavy_minus_sign: | Status of the transaction. | Completed | +| `message` | *string* | :heavy_minus_sign: | Metadata such as validation errors or the resulting record created in the accounting software. | | | `integrationType` | [shared.IntegrationType](../../../sdk/models/shared/integrationtype.md) | :heavy_minus_sign: | Type of transaction that has been processed e.g. Expense or Bank Feed. | expenses | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transactions.md b/sync-for-expenses/docs/sdk/models/shared/transactions.md index 13da35818..a6a6cba5b 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transactions.md +++ b/sync-for-expenses/docs/sdk/models/shared/transactions.md @@ -1,31 +1,23 @@ -# Transactions - -## Example Usage - -```typescript -import { Transactions } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Transactions = { - pageNumber: 1, - pageSize: 10, - totalResults: 1, - links: { - self: { - href: "/companies/{id}/data/{dataType}", - }, - current: { - href: "/companies/{id}/data/{dataType}?page=1&pageSize=10", - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | -| `results` | [shared.Transaction](../../../sdk/models/shared/transaction.md)[] | :heavy_minus_sign: | N/A | | -| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | | -| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | | -| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | | -| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | {
"self": {
"href": "/companies"
},
"current": {
"href": "/companies?page=1\u0026pageSize=10"
}
} | \ No newline at end of file +# Transactions + +## Example Usage + +```typescript +import { Transactions } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Transactions = { + pageNumber: 0, + pageSize: 0, + totalResults: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | +| `pageNumber` | *number* | :heavy_check_mark: | Current page number. | +| `pageSize` | *number* | :heavy_check_mark: | Number of items to return in results array. | +| `totalResults` | *number* | :heavy_check_mark: | Total number of items. | +| `links` | [shared.Links](../../../sdk/models/shared/links.md) | :heavy_check_mark: | N/A | +| `results` | [shared.Transaction](../../../sdk/models/shared/transaction.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transactionstatus.md b/sync-for-expenses/docs/sdk/models/shared/transactionstatus.md index ce14a1911..9bae1b247 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transactionstatus.md +++ b/sync-for-expenses/docs/sdk/models/shared/transactionstatus.md @@ -1,17 +1,17 @@ -# TransactionStatus - -Status of the transaction. - -## Example Usage - -```typescript -import { TransactionStatus } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TransactionStatus = "Completed"; -``` - -## Values - -```typescript -"Unknown" | "Pending" | "ValidationError" | "Completed" | "PushError" +# TransactionStatus + +Status of the transaction. + +## Example Usage + +```typescript +import { TransactionStatus } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TransactionStatus = "Unknown"; +``` + +## Values + +```typescript +"Unknown" | "Pending" | "ValidationError" | "Completed" | "PushError" ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transactionstatus1.md b/sync-for-expenses/docs/sdk/models/shared/transactionstatus1.md index b988f771f..976404ffb 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transactionstatus1.md +++ b/sync-for-expenses/docs/sdk/models/shared/transactionstatus1.md @@ -1,17 +1,15 @@ -# TransactionStatus1 - -Status of transaction. - -## Example Usage - -```typescript -import { TransactionStatus1 } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TransactionStatus1 = "PushError"; -``` - -## Values - -```typescript -"Unknown" | "PushError" | "Completed" | "Failed" | "Pending" +# TransactionStatus1 + +## Example Usage + +```typescript +import { TransactionStatus1 } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TransactionStatus1 = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequest.md b/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequest.md index 2a745159e..7c7d749c4 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequest.md @@ -1,34 +1,33 @@ -# TransferTransactionRequest - -## Example Usage - -```typescript -import { TransferTransactionRequest } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: TransferTransactionRequest = { - description: "Transfer from bank account Y to bank account Z", - date: "2022-10-23T00:00:00Z", - from: { - accountRef: { - id: "", - }, - amount: new Decimal("2003.32"), - }, - to: { - accountRef: { - id: "", - }, - amount: new Decimal("625.97"), - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------- | -| `description` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | Transfer from bank account Y to bank account Z | -| `date` | *string* | :heavy_check_mark: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `from` | [shared.From](../../../sdk/models/shared/from.md) | :heavy_check_mark: | N/A | | -| `to` | [shared.To](../../../sdk/models/shared/to.md) | :heavy_check_mark: | N/A | | \ No newline at end of file +# TransferTransactionRequest + +## Example Usage + +```typescript +import { TransferTransactionRequest } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TransferTransactionRequest = { + description: "Transfer from bank account Y to bank account Z", + date: "string", + from: { + accountRef: { + id: "string", + }, + amount: 0, + }, + to: { + accountRef: { + id: "string", + }, + amount: 0, + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | ------------------------------------------------------------------------ | +| `description` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | Transfer from bank account Y to bank account Z | +| `date` | *string* | :heavy_check_mark: | Date of the transfer transaction as recorded in the accounting software. | | +| `from` | [shared.From](../../../sdk/models/shared/from.md) | :heavy_check_mark: | N/A | | +| `to` | [shared.To](../../../sdk/models/shared/to.md) | :heavy_check_mark: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequestaccountreference.md b/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequestaccountreference.md index d58253c95..bed555207 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequestaccountreference.md +++ b/sync-for-expenses/docs/sdk/models/shared/transfertransactionrequestaccountreference.md @@ -1,19 +1,15 @@ -# TransferTransactionRequestAccountReference - -Reference of the account you are transferring money to. - -## Example Usage - -```typescript -import { TransferTransactionRequestAccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TransferTransactionRequestAccountReference = { - id: "", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | +# TransferTransactionRequestAccountReference + +## Example Usage + +```typescript +import { TransferTransactionRequestAccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TransferTransactionRequestAccountReference = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| --------------------------------- | --------------------------------- | --------------------------------- | --------------------------------- | | `id` | *string* | :heavy_check_mark: | 'id' from the Accounts data type. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/transfertransactionresponse.md b/sync-for-expenses/docs/sdk/models/shared/transfertransactionresponse.md index 34706236c..cf2e265ca 100644 --- a/sync-for-expenses/docs/sdk/models/shared/transfertransactionresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/transfertransactionresponse.md @@ -1,17 +1,17 @@ -# TransferTransactionResponse - -## Example Usage - -```typescript -import { TransferTransactionResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: TransferTransactionResponse = { - syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | +# TransferTransactionResponse + +## Example Usage + +```typescript +import { TransferTransactionResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: TransferTransactionResponse = { + syncId: "cd937d46-8e41-43a9-9477-a79158ffd98a", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | | `syncId` | *string* | :heavy_minus_sign: | Unique id of sync created | cd937d46-8e41-43a9-9477-a79158ffd98a | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/type.md b/sync-for-expenses/docs/sdk/models/shared/type.md index b39ccc356..a0379b582 100644 --- a/sync-for-expenses/docs/sdk/models/shared/type.md +++ b/sync-for-expenses/docs/sdk/models/shared/type.md @@ -1,17 +1,15 @@ -# Type - -The type of transaction. - -## Example Usage - -```typescript -import { Type } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Type = "Payment"; -``` - -## Values - -```typescript -"Payment" | "Refund" | "Reward" | "Chargeback" +# Type + +## Example Usage + +```typescript +import { Type } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Type = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponse.md b/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponse.md index e4ed8307b..d7e30f435 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponse.md @@ -1,57 +1,36 @@ -# UpdateCustomerResponse - -## Example Usage - -```typescript -import { UpdateCustomerResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateCustomerResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Archived", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Unknown", - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "ba87ad2c-abb7-4be6-8a33-7c96d5ec70d0", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Failed", - statusCode: 813712, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.UpdateCustomerResponseAccountingCustomer](../../../sdk/models/shared/updatecustomerresponseaccountingcustomer.md) | :heavy_minus_sign: | N/A | | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# UpdateCustomerResponse + +## Example Usage + +```typescript +import { UpdateCustomerResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateCustomerResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | *UpdateCustomerResponseAccountingCustomer* | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponseaccountingcustomer.md b/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponseaccountingcustomer.md index 72325ddee..434adee6d 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponseaccountingcustomer.md +++ b/sync-for-expenses/docs/sdk/models/shared/updatecustomerresponseaccountingcustomer.md @@ -1,50 +1,29 @@ -# ~~UpdateCustomerResponseAccountingCustomer~~ - -## Overview - -A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - -Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { UpdateCustomerResponseAccountingCustomer } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateCustomerResponseAccountingCustomer = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Archived", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Active", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | | -| `customerName` | *string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the identified customer. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address the customer can be contacted by. | | -| `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. | **Example 1:** GBP
**Example 2:** USD
**Example 3:** EUR | -| `phone` | *string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | | -| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `contacts` | [shared.Contact](../../../sdk/models/shared/contact.md)[] | :heavy_minus_sign: | An array of Contacts. | | -| `registrationNumber` | *string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | | -| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Status of customer. | | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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 +# UpdateCustomerResponseAccountingCustomer + +## Example Usage + +```typescript +import { UpdateCustomerResponseAccountingCustomer } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateCustomerResponseAccountingCustomer = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the customer, unique to the company in the accounting software. | +| `customerName` | *string* | :heavy_minus_sign: | Name of the customer as recorded in the accounting system, typically the company name. | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the identified customer. | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address the customer can be contacted by. | +| `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. | +| `phone` | *string* | :heavy_minus_sign: | Phone number the customer can be contacted by. | +| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | +| `contacts` | [shared.Contact](../../../sdk/models/shared/contact.md)[] | :heavy_minus_sign: | An array of Contacts. | +| `registrationNumber` | *string* | :heavy_minus_sign: | Company number. In the UK, this is typically the Companies House company registration number. | +| `taxNumber` | *string* | :heavy_minus_sign: | Company tax number. | +| `status` | [shared.CustomerStatus](../../../sdk/models/shared/customerstatus.md) | :heavy_check_mark: | Current state of the customer. | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updateexpenserequest.md b/sync-for-expenses/docs/sdk/models/shared/updateexpenserequest.md index 5025fc726..ba647388b 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updateexpenserequest.md +++ b/sync-for-expenses/docs/sdk/models/shared/updateexpenserequest.md @@ -1,60 +1,29 @@ -# UpdateExpenseRequest - -## Example Usage - -```typescript -import { UpdateExpenseRequest } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: UpdateExpenseRequest = { - type: "Payment", - issueDate: "2022-06-28T00:00:00.000Z", - currency: "GBP", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - bankAccountRef: { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `type` | [shared.UpdateExpenseRequestType](../../../sdk/models/shared/updateexpenserequesttype.md) | :heavy_check_mark: | The type of transaction. | Payment | -| `issueDate` | *string* | :heavy_check_mark: | Date the transaction was recorded. | 2022-06-28T00:00:00.000Z | -| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | -| `contactRef` | [shared.ExpenseContactRef](../../../sdk/models/shared/expensecontactref.md) | :heavy_minus_sign: | N/A | | -| `bankAccountRef` | [shared.UpdateExpenseRequestBankAccountReference](../../../sdk/models/shared/updateexpenserequestbankaccountreference.md) | :heavy_minus_sign: | N/A | | -| `merchantName` | *string* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | -| `lines` | [shared.ExpenseTransactionLine](../../../sdk/models/shared/expensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | +# UpdateExpenseRequest + +## Example Usage + +```typescript +import { UpdateExpenseRequest } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateExpenseRequest = { + type: "Payment", + issueDate: "2022-06-28T00:00:00.000Z", + currency: "GBP", + merchantName: "Amazon UK", + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `type` | [shared.UpdateExpenseRequestType](../../../sdk/models/shared/updateexpenserequesttype.md) | :heavy_check_mark: | The type of transaction. | Payment | +| `issueDate` | *string* | :heavy_check_mark: | Date the transaction was recorded. | 2022-06-28T00:00:00.000Z | +| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `currencyRate` | *Decimal | number* | :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. \| | | +| `contactRef` | [shared.ExpenseContactRef](../../../sdk/models/shared/expensecontactref.md) | :heavy_minus_sign: | Supplier or Customer for the purchase to be associated to. | | +| `bankAccountRef` | *UpdateExpenseRequestBankAccountReference* | :heavy_minus_sign: | N/A | | +| `merchantName` | *string* | :heavy_minus_sign: | Name of the merchant where the purchase took place | Amazon UK | +| `lines` | [shared.ExpenseTransactionLine](../../../sdk/models/shared/expensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | | `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updateexpenserequestbankaccountreference.md b/sync-for-expenses/docs/sdk/models/shared/updateexpenserequestbankaccountreference.md index 53dd6c294..3bcaa8f9c 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updateexpenserequestbankaccountreference.md +++ b/sync-for-expenses/docs/sdk/models/shared/updateexpenserequestbankaccountreference.md @@ -1,17 +1,15 @@ -# UpdateExpenseRequestBankAccountReference - -## Example Usage - -```typescript -import { UpdateExpenseRequestBankAccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateExpenseRequestBankAccountReference = { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | ------------------------------------ | -| `id` | *string* | :heavy_minus_sign: | Identifier of the bank account. | 787dfb37-5707-4dc0-8a86-8d74e4cc78ea | \ No newline at end of file +# UpdateExpenseRequestBankAccountReference + +## Example Usage + +```typescript +import { UpdateExpenseRequestBankAccountReference } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateExpenseRequestBankAccountReference = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------- | ------------------------------- | ------------------------------- | ------------------------------- | +| `id` | *string* | :heavy_minus_sign: | Identifier of the bank account. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updateexpenserequesttype.md b/sync-for-expenses/docs/sdk/models/shared/updateexpenserequesttype.md index e669a7456..ed2d4ce49 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updateexpenserequesttype.md +++ b/sync-for-expenses/docs/sdk/models/shared/updateexpenserequesttype.md @@ -1,17 +1,15 @@ -# UpdateExpenseRequestType - -The type of transaction. - -## Example Usage - -```typescript -import { UpdateExpenseRequestType } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateExpenseRequestType = "Payment"; -``` - -## Values - -```typescript -"Payment" | "Refund" | "Reward" | "Chargeback" +# UpdateExpenseRequestType + +## Example Usage + +```typescript +import { UpdateExpenseRequestType } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateExpenseRequestType = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updateexpenseresponse.md b/sync-for-expenses/docs/sdk/models/shared/updateexpenseresponse.md index 50f783cc3..01101d564 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updateexpenseresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/updateexpenseresponse.md @@ -1,17 +1,17 @@ -# UpdateExpenseResponse - -## Example Usage - -```typescript -import { UpdateExpenseResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateExpenseResponse = { - syncId: "1ad0695c-4566-4715-918c-adbb03eac81e", -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | +# UpdateExpenseResponse + +## Example Usage + +```typescript +import { UpdateExpenseResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateExpenseResponse = { + syncId: "1ad0695c-4566-4715-918c-adbb03eac81e", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | ---------------------------------------------- | | `syncId` | *string* | :heavy_minus_sign: | Unique identifier for the update expense sync. | 1ad0695c-4566-4715-918c-adbb03eac81e | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updatereimbursableexpensetransactionrequest.md b/sync-for-expenses/docs/sdk/models/shared/updatereimbursableexpensetransactionrequest.md index 322eb58b7..e3a5f86ea 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updatereimbursableexpensetransactionrequest.md +++ b/sync-for-expenses/docs/sdk/models/shared/updatereimbursableexpensetransactionrequest.md @@ -1,60 +1,34 @@ -# UpdateReimbursableExpenseTransactionRequest - -## Example Usage - -```typescript -import { UpdateReimbursableExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/shared"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -let value: UpdateReimbursableExpenseTransactionRequest = { - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: { - id: "8000004C-1724173136", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | -| `contactRef` | [shared.ReimbursementContactRef](../../../sdk/models/shared/reimbursementcontactref.md) | :heavy_check_mark: | N/A | | -| `apAccountRef` | [shared.ApAccountRef](../../../sdk/models/shared/apaccountref.md) | :heavy_minus_sign: | N/A | | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `dueDate` | *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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | -| `currencyRate` | *Decimal* | :heavy_minus_sign: | Rate to convert the total amount of the payment into the base currency for the company at the time of the payment.

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

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

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

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

## Examples with base currency of GBP

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

## Examples with base currency of USD

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


### Integration-specific details

\| Integration \| Scenario \| System behavior \|
\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|
\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, specify a currencyRate in the request body. \| | | -| `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | -| `lines` | [shared.ReimbursableExpenseTransactionLine](../../../sdk/models/shared/reimbursableexpensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | \ No newline at end of file +# UpdateReimbursableExpenseTransactionRequest + +## Example Usage + +```typescript +import { UpdateReimbursableExpenseTransactionRequest } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateReimbursableExpenseTransactionRequest = { + contactRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + issueDate: "string", + dueDate: "string", + currency: "GBP", + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `reference` | *string* | :heavy_minus_sign: | User-friendly reference for the reimbursable expense. | | +| `contactRef` | [shared.ReimbursementContactRef](../../../sdk/models/shared/reimbursementcontactref.md) | :heavy_check_mark: | N/A | | +| `apAccountRef` | [shared.ApAccountRef](../../../sdk/models/shared/apaccountref.md) | :heavy_minus_sign: | N/A | | +| `issueDate` | *string* | :heavy_check_mark: | Date of the transaction was recorded. | | +| `dueDate` | *string* | :heavy_check_mark: | Date the supplier is due to be paid. | | +| `currency` | *string* | :heavy_check_mark: | Currency the transaction was recorded in. | GBP | +| `currencyRate` | *Decimal | number* | :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. \| | | +| `notes` | *string* | :heavy_minus_sign: | Any private, company notes about the transaction. | APPLE.COM/BILL - 09001077498 - Card Ending: 4590 | +| `lines` | [shared.ReimbursableExpenseTransactionLine](../../../sdk/models/shared/reimbursableexpensetransactionline.md)[] | :heavy_minus_sign: | Array of transaction lines. | | +| `companyId` | *string* | :heavy_minus_sign: | N/A | | +| `transactionId` | *string* | :heavy_minus_sign: | N/A | | +| `updateReimbursableExpenseTransactionRequest` | [operations.UpdateReimbursableExpenseTransactionRequest](../../../sdk/models/operations/updatereimbursableexpensetransactionrequest.md) | :heavy_minus_sign: | N/A | | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponse.md b/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponse.md index 2f9eab7ad..e76bbfb69 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponse.md +++ b/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponse.md @@ -1,82 +1,75 @@ -# UpdateSupplierResponse - -## Example Usage - -```typescript -import { UpdateSupplierResponse } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateSupplierResponse = { - data: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, - }, - changes: [ - { - recordRef: { - dataType: "invoices", - }, - }, - ], - dataType: "invoices", - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "34fa14e2-bb15-4ba5-b65a-a72a3aa6e3df", - dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestedOnUtc: "2022-10-23T00:00:00Z", - completedOnUtc: "2022-10-23T00:00:00Z", - status: "Pending", - statusCode: 134294, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `data` | [shared.UpdateSupplierResponseAccountingSupplier](../../../sdk/models/shared/updatesupplierresponseaccountingsupplier.md) | :heavy_minus_sign: | N/A | {
"id": "C520FFD4-F6F6-4FC2-A6D2-5D7088B2B14F",
"supplierName": "Kelly's Industrial Supplies",
"contactName": "Kelly's Industrial Supplies",
"emailAddress": "sales@kellysupplies.com",
"phone": "07999 999999",
"addresses": [
{
"type": "Billing",
"line1": "Unit 51",
"line2": "Bakersfield Industrial Estate",
"city": "Bakersfield",
"region": "California",
"country": "USA",
"postalcode": "93308"
}
],
"registrationNumber": "string",
"taxNumber": "string",
"status": "Unknown",
"defaultCurrency": "string",
"metadata": {
"isDeleted": true
},
"supplementalData": {
"content": {
"property1": {
"property1": null,
"property2": null
},
"property2": {
"property1": null,
"property2": null
}
}
},
"modifiedDate": "2022-10-23T00:00:00Z",
"sourceModifiedDate": "2022-10-23T00:00:00Z"
} | -| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | -| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | -| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | -| `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. | | -| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `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. | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | -| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | -| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | -| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | -| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | -| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | \ No newline at end of file +# UpdateSupplierResponse + +## Example Usage + +```typescript +import { UpdateSupplierResponse } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateSupplierResponse = { + dataType: "invoices", + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + pushOperationKey: "string", + dataConnectionKey: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestedOnUtc: "string", + status: "string", + statusCode: 0, + data: { + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + }, +}; +``` + +## Fields + +| Field | Type | Required | Description | Example | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `changes` | [shared.PushOperationChange](../../../sdk/models/shared/pushoperationchange.md)[] | :heavy_minus_sign: | Contains a single entry that communicates which record has changed and the manner in which it changed. | | +| `dataType` | [shared.PropertieDataType](../../../sdk/models/shared/propertiedatatype.md) | :heavy_minus_sign: | Available data types | invoices | +| `companyId` | *string* | :heavy_check_mark: | Unique identifier for your SMB in Codat. | 8a210b68-6988-11ed-a1eb-0242ac120002 | +| `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. | | +| `dataConnectionKey` | *string* | :heavy_check_mark: | Unique identifier for a company's data connection. | 2e9d2c44-f675-40ba-8049-353bfcb5e171 | +| `requestedOnUtc` | *string* | :heavy_check_mark: | The datetime when the push was requested. | | +| `completedOnUtc` | *string* | :heavy_minus_sign: | The datetime when the push was completed, null if Pending. | | +| `timeoutInMinutes` | *number* | :heavy_minus_sign: | Number of minutes the push operation must complete within before it times out. | | +| ~~`timeoutInSeconds`~~ | *number* | :heavy_minus_sign: | : warning: ** DEPRECATED **: This will be removed in a future release, please migrate away from it as soon as possible.

Number of seconds the push operation must complete within before it times out. | | +| `status` | [shared.PushOperationStatus](../../../sdk/models/shared/pushoperationstatus.md) | :heavy_check_mark: | The current status of the push operation. | | +| `errorMessage` | *string* | :heavy_minus_sign: | A message about the error. | | +| `validation` | [shared.Validation](../../../sdk/models/shared/validation.md) | :heavy_minus_sign: | A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. | | +| `statusCode` | *number* | :heavy_check_mark: | Push status code. | | +| `data` | *UpdateSupplierResponseAccountingSupplier* | :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"
} | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponseaccountingsupplier.md b/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponseaccountingsupplier.md index 548a8113e..00cd00c79 100644 --- a/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponseaccountingsupplier.md +++ b/sync-for-expenses/docs/sdk/models/shared/updatesupplierresponseaccountingsupplier.md @@ -1,71 +1,28 @@ -# ~~UpdateSupplierResponseAccountingSupplier~~ - -## Overview - -From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - -> :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible. - -## Example Usage - -```typescript -import { UpdateSupplierResponseAccountingSupplier } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: UpdateSupplierResponseAccountingSupplier = { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, -}; -``` - -## Fields - -| Field | Type | Required | Description | Example | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `modifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | **Example 1:** 2022-10-23T00:00:00Z
**Example 2:** 2022-10-23 | -| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | | -| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | | -| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | | -| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | | -| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | **Example 1:** +44 25691 154789
**Example 2:** (877) 492-8687
**Example 3:** 01224 658 999 | -| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | | -| `registrationNumber` | *string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | | -| `taxNumber` | *string* | :heavy_minus_sign: | Supplier's company tax number. | | -| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | Status of the supplier. | | -| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | | -| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | | -| `supplementalData` | [shared.SupplementalData](../../../sdk/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 +# UpdateSupplierResponseAccountingSupplier + +## Example Usage + +```typescript +import { UpdateSupplierResponseAccountingSupplier } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: UpdateSupplierResponseAccountingSupplier = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| `modifiedDate` | *string* | :heavy_minus_sign: | The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)).

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `sourceModifiedDate` | *string* | :heavy_minus_sign: | The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when:
- Pulling attachments
- The accounting software does not provide modification dates for a data type
- A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
- A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records

In Codat's data model, dates and times are represented using the ISO 8601 standard. | +| `id` | *string* | :heavy_minus_sign: | Identifier for the supplier, unique to the company in the accounting software. | +| `supplierName` | *string* | :heavy_minus_sign: | Name of the supplier as recorded in the accounting system, typically the company name. | +| `contactName` | *string* | :heavy_minus_sign: | Name of the main contact for the supplier. | +| `emailAddress` | *string* | :heavy_minus_sign: | Email address that the supplier may be contacted on. | +| `phone` | *string* | :heavy_minus_sign: | Phone number that the supplier may be contacted on. | +| `addresses` | [shared.Items](../../../sdk/models/shared/items.md)[] | :heavy_minus_sign: | An array of Addresses. | +| `registrationNumber` | *string* | :heavy_minus_sign: | Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. | +| `taxNumber` | *string* | :heavy_minus_sign: | Supplier's company tax number. | +| `status` | [shared.SupplierStatus](../../../sdk/models/shared/supplierstatus.md) | :heavy_check_mark: | N/A | +| `defaultCurrency` | *string* | :heavy_minus_sign: | Default currency the supplier's transactional data is recorded in. | +| `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | +| `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/validation.md b/sync-for-expenses/docs/sdk/models/shared/validation.md index 1c4627741..d60320f47 100644 --- a/sync-for-expenses/docs/sdk/models/shared/validation.md +++ b/sync-for-expenses/docs/sdk/models/shared/validation.md @@ -1,18 +1,18 @@ -# Validation - -A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - -## Example Usage - -```typescript -import { Validation } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Validation = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | -| `errors` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | +# Validation + +A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + +## Example Usage + +```typescript +import { Validation } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Validation = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | ----------------------------------------------------------------------- | +| `errors` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | | `warnings` | [shared.ValidationItem](../../../sdk/models/shared/validationitem.md)[] | :heavy_minus_sign: | N/A | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/validationitem.md b/sync-for-expenses/docs/sdk/models/shared/validationitem.md index 1f16ed7a8..8252f0ee0 100644 --- a/sync-for-expenses/docs/sdk/models/shared/validationitem.md +++ b/sync-for-expenses/docs/sdk/models/shared/validationitem.md @@ -1,17 +1,17 @@ -# ValidationItem - -## Example Usage - -```typescript -import { ValidationItem } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ValidationItem = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | -| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | +# ValidationItem + +## Example Usage + +```typescript +import { ValidationItem } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ValidationItem = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | -------------------------------------------- | +| `itemId` | *string* | :heavy_minus_sign: | Unique identifier for a validation item. | +| `message` | *string* | :heavy_minus_sign: | A message outlining validation item's issue. | | `validatorName` | *string* | :heavy_minus_sign: | Name of validator. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/validdatatypelinks.md b/sync-for-expenses/docs/sdk/models/shared/validdatatypelinks.md index 0649c091b..749552a45 100644 --- a/sync-for-expenses/docs/sdk/models/shared/validdatatypelinks.md +++ b/sync-for-expenses/docs/sdk/models/shared/validdatatypelinks.md @@ -1,57 +1,57 @@ -# ValidDataTypeLinks - -When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. - -For example, `validDatatypeLinks` might indicate the following references: - -- Which tax rates are valid to use on the line item of a bill. -- Which items can be used when creating an invoice. - -You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. - -## `validDatatypeLinks` example - -The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. - -```json validDatatypeLinks for an account -{ - "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", - "nominalCode": "090", - "name": "Business Bank Account", - #... - "validDatatypeLinks": [ - { - "property": "Id", - "links": [ - "Payment.AccountRef.Id", - "BillPayment.AccountRef.Id", - "DirectIncome.LineItems.AccountRef.Id", - "DirectCost.LineItems.AccountRef.Id" - ] - } - ] - } -``` - - - -## Support for `validDatatypeLinks` - -Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. - -If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. - -## Example Usage - -```typescript -import { ValidDataTypeLinks } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ValidDataTypeLinks = {}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | -| `property` | *string* | :heavy_minus_sign: | The property from the account that can be linked. | +# ValidDataTypeLinks + +When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + +For example, `validDatatypeLinks` might indicate the following references: + +- Which tax rates are valid to use on the line item of a bill. +- Which items can be used when creating an invoice. + +You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + +## `validDatatypeLinks` example + +The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + +```json validDatatypeLinks for an account +{ + "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + "nominalCode": "090", + "name": "Business Bank Account", + #... + "validDatatypeLinks": [ + { + "property": "Id", + "links": [ + "Payment.AccountRef.Id", + "BillPayment.AccountRef.Id", + "DirectIncome.LineItems.AccountRef.Id", + "DirectCost.LineItems.AccountRef.Id" + ] + } + ] + } +``` + + + +## Support for `validDatatypeLinks` + +Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + +If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + +## Example Usage + +```typescript +import { ValidDataTypeLinks } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ValidDataTypeLinks = {}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | +| `property` | *string* | :heavy_minus_sign: | The property from the account that can be linked. | | `links` | *string*[] | :heavy_minus_sign: | Supported `dataTypes` that the record can be linked to. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/validfor.md b/sync-for-expenses/docs/sdk/models/shared/validfor.md index e0a384b87..79ae663fd 100644 --- a/sync-for-expenses/docs/sdk/models/shared/validfor.md +++ b/sync-for-expenses/docs/sdk/models/shared/validfor.md @@ -1,15 +1,15 @@ -# ValidFor - -## Example Usage - -```typescript -import { ValidFor } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ValidFor = "expense-transactions.Payment"; -``` - -## Values - -```typescript -"expense-transactions.Payment" | "expense-transactions.Refund" | "expense-transactions.Reward" | "expense-transactions.Chargeback" | "reimbursable-expense-transactions" | "transfer-transactions" | "adjustment-transactions" +# ValidFor + +## Example Usage + +```typescript +import { ValidFor } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ValidFor = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/validtransactiontypes.md b/sync-for-expenses/docs/sdk/models/shared/validtransactiontypes.md index fd9faf538..dc6e28ba7 100644 --- a/sync-for-expenses/docs/sdk/models/shared/validtransactiontypes.md +++ b/sync-for-expenses/docs/sdk/models/shared/validtransactiontypes.md @@ -1,15 +1,15 @@ -# ValidTransactionTypes - -## Example Usage - -```typescript -import { ValidTransactionTypes } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: ValidTransactionTypes = "Payment"; -``` - -## Values - -```typescript -"Payment" | "Refund" | "Reward" | "Chargeback" +# ValidTransactionTypes + +## Example Usage + +```typescript +import { ValidTransactionTypes } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: ValidTransactionTypes = ""; +``` + +## Values + +```typescript + ``` \ No newline at end of file diff --git a/sync-for-expenses/docs/sdk/models/shared/weblink.md b/sync-for-expenses/docs/sdk/models/shared/weblink.md index 6ab614a2a..e9cd4ce26 100644 --- a/sync-for-expenses/docs/sdk/models/shared/weblink.md +++ b/sync-for-expenses/docs/sdk/models/shared/weblink.md @@ -1,21 +1,21 @@ -# Weblink - -Weblink associated with the company. - -## Example Usage - -```typescript -import { Weblink } from "@codat/sync-for-expenses/sdk/models/shared"; - -let value: Weblink = { - type: "Website", - url: "https://codat.io", -}; -``` - -## Fields - -| Field | Type | Required | Description | -| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | -| `type` | [shared.CompanyInformationType](../../../sdk/models/shared/companyinformationtype.md) | :heavy_minus_sign: | The type of the weblink. | +# Weblink + +Weblink associated with the company. + +## Example Usage + +```typescript +import { Weblink } from "@codat/sync-for-expenses/sdk/models/shared"; + +let value: Weblink = { + type: "Website", + url: "https://codat.io", +}; +``` + +## Fields + +| Field | Type | Required | Description | +| ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| `type` | [shared.CompanyInformationType](../../../sdk/models/shared/companyinformationtype.md) | :heavy_minus_sign: | The type of the weblink. | | `url` | *string* | :heavy_minus_sign: | The full URL for the weblink. | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/accounts/README.md b/sync-for-expenses/docs/sdks/accounts/README.md index 1efcbdfc8..ce42ff787 100644 --- a/sync-for-expenses/docs/sdks/accounts/README.md +++ b/sync-for-expenses/docs/sdks/accounts/README.md @@ -1,659 +1,657 @@ -# Accounts - -## Overview - -Create accounts and view create account options. - -### Available Operations - -* [create](#create) - Create account -* [getCreateModel](#getcreatemodel) - Get create account model - -## create - -The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. - -[Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountPrototype: { - nominalCode: "610", - name: "Accounts Receivable", - description: "Invoices the business has issued but has not yet collected payment on.", - fullyQualifiedCategory: "Asset.Current", - fullyQualifiedName: "Cash On Hand", - currency: "GBP", - currentBalance: new Decimal("0"), - type: "Asset", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsCreate } from "@codat/sync-for-expenses/funcs/accountsCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - accountPrototype: { - nominalCode: "610", - name: "Accounts Receivable", - description: "Invoices the business has issued but has not yet collected payment on.", - fullyQualifiedCategory: "Asset.Current", - fullyQualifiedName: "Cash On Hand", - currency: "GBP", - currentBalance: new Decimal("0"), - type: "Asset", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateAccountRequest](../../sdk/models/operations/createaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateAccountResponse](../../sdk/models/shared/createaccountresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.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/sync-for-expenses-api#/schemas/Account) for a given company and integration. - -[Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - -**Integration-specific behavior** - -See the *response examples* for integration-specific indicative models. - -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: MYOB AccountRight and Essentials - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.accounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await accountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("accountsGetCreateModel failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCreateChartOfAccountsModelRequest](../../sdk/models/operations/getcreatechartofaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Accounts + +## Overview + +Create accounts and view create account options. + +### Available Operations + +* [create](#create) - Create account +* [getCreateModel](#getcreatemodel) - Get create account model + +## create + +The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. + +[Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountPrototype: { + nominalCode: "610", + name: "Accounts Receivable", + description: "Invoices the business has issued but has not yet collected payment on.", + fullyQualifiedCategory: "Asset.Current", + fullyQualifiedName: "Cash On Hand", + currency: "GBP", + currentBalance: 0, + type: "Asset", + status: "Active", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsCreate } from "@codat/sync-for-expenses/funcs/accountsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + accountPrototype: { + nominalCode: "610", + name: "Accounts Receivable", + description: "Invoices the business has issued but has not yet collected payment on.", + fullyQualifiedCategory: "Asset.Current", + fullyQualifiedName: "Cash On Hand", + currency: "GBP", + currentBalance: 0, + type: "Asset", + status: "Active", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateAccountRequest](../../sdk/models/operations/createaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateAccountResponse](../../sdk/models/shared/createaccountresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.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/sync-for-expenses-api#/schemas/Account) for a given company and integration. + +[Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. + +**Integration-specific behavior** + +See the *response examples* for integration-specific indicative models. + +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: MYOB AccountRight and Essentials + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.accounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { accountsGetCreateModel } from "@codat/sync-for-expenses/funcs/accountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await accountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("accountsGetCreateModel failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateChartOfAccountsModelRequest](../../sdk/models/operations/getcreatechartofaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/adjustments/README.md b/sync-for-expenses/docs/sdks/adjustments/README.md index 4abaf777b..3bdbee5f5 100644 --- a/sync-for-expenses/docs/sdks/adjustments/README.md +++ b/sync-for-expenses/docs/sdks/adjustments/README.md @@ -1,302 +1,276 @@ -# Adjustments - -## Overview - -Create transactions that represent your adjustments to your customers' spend. - -### Available Operations - -* [create](#create) - Create adjustment transaction - -## create - -Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. - -Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. - -### Supported Integrations - -| Integration | Supported | -|-----------------------|-----------| -| QuickBooks Desktop | Yes | - -### Example Usage: Create adjustment - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.adjustments.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "3357b3df-5f2e-465d-b9ba-226519dbb8f1", - date: "2024-05-21T00:00:00+00:00", - currency: "USD", - currencyRate: new Decimal("1"), - reference: "test reference", - lines: [ - { - amount: new Decimal("50"), - accountRef: { - id: "80000018-1671793811", - }, - description: "debit line", - trackingRefs: [ - { - id: "80000003-1674553958", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - { - amount: new Decimal("-50"), - accountRef: { - id: "80000028-1671794219", - }, - description: "credit line", - trackingRefs: [ - { - id: "80000003-1674553958", - }, - ], - }, - ], - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { adjustmentsCreate } from "@codat/sync-for-expenses/funcs/adjustmentsCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await adjustmentsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "3357b3df-5f2e-465d-b9ba-226519dbb8f1", - date: "2024-05-21T00:00:00+00:00", - currency: "USD", - currencyRate: new Decimal("1"), - reference: "test reference", - lines: [ - { - amount: new Decimal("50"), - accountRef: { - id: "80000018-1671793811", - }, - description: "debit line", - trackingRefs: [ - { - id: "80000003-1674553958", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - { - amount: new Decimal("-50"), - accountRef: { - id: "80000028-1671794219", - }, - description: "credit line", - trackingRefs: [ - { - id: "80000003-1674553958", - }, - ], - }, - ], - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("adjustmentsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Example 1 - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.adjustments.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "6a13b8cf-d482-4389-9f93-08d52faa3dc0", - date: "2022-10-23T00:00:00Z", - currency: "Lilangeni", - lines: [], - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { adjustmentsCreate } from "@codat/sync-for-expenses/funcs/adjustmentsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await adjustmentsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "6a13b8cf-d482-4389-9f93-08d52faa3dc0", - date: "2022-10-23T00:00:00Z", - currency: "Lilangeni", - lines: [], - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("adjustmentsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.adjustments.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "6a13b8cf-d482-4389-9f93-08d52faa3dc0", - date: "2022-10-23T00:00:00Z", - currency: "Lilangeni", - lines: [], - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { adjustmentsCreate } from "@codat/sync-for-expenses/funcs/adjustmentsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await adjustmentsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "6a13b8cf-d482-4389-9f93-08d52faa3dc0", - date: "2022-10-23T00:00:00Z", - currency: "Lilangeni", - lines: [], - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("adjustmentsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateAdjustmentTransactionRequest](../../sdk/models/operations/createadjustmenttransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.AdjustmentTransactionResponse](../../sdk/models/shared/adjustmenttransactionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Adjustments + +## Overview + +Create transactions that represent your adjustments to your customers' spend. + +### Available Operations + +* [create](#create) - Create adjustment transaction + +## create + +Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. + +Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. + +### Supported Integrations + +| Integration | Supported | +|-----------------------|-----------| +| QuickBooks Desktop | Yes | + +### Example Usage: Create adjustment + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.adjustments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "3357b3df-5f2e-465d-b9ba-226519dbb8f1", + date: "2024-05-21T00:00:00+00:00", + currency: "USD", + currencyRate: 1, + reference: "test reference", + lines: [ + { + amount: 50, + accountRef: { + id: "80000018-1671793811", + }, + description: "debit line", + trackingRefs: [ + { + id: "80000003-1674553958", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "80000002-1674552702", + type: "customer", + }, + }, + { + amount: -50, + accountRef: { + id: "80000028-1671794219", + }, + description: "credit line", + trackingRefs: [ + { + id: "80000003-1674553958", + dataType: "trackingCategories", + }, + ], + }, + ], + }, + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { adjustmentsCreate } from "@codat/sync-for-expenses/funcs/adjustmentsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await adjustmentsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "3357b3df-5f2e-465d-b9ba-226519dbb8f1", + date: "2024-05-21T00:00:00+00:00", + currency: "USD", + currencyRate: 1, + reference: "test reference", + lines: [ + { + amount: 50, + accountRef: { + id: "80000018-1671793811", + }, + description: "debit line", + trackingRefs: [ + { + id: "80000003-1674553958", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "80000002-1674552702", + type: "customer", + }, + }, + { + amount: -50, + accountRef: { + id: "80000028-1671794219", + }, + description: "credit line", + trackingRefs: [ + { + id: "80000003-1674553958", + dataType: "trackingCategories", + }, + ], + }, + ], + }, + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("adjustmentsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Example 1 + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.adjustments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { adjustmentsCreate } from "@codat/sync-for-expenses/funcs/adjustmentsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await adjustmentsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("adjustmentsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.adjustments.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { adjustmentsCreate } from "@codat/sync-for-expenses/funcs/adjustmentsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await adjustmentsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("adjustmentsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateAdjustmentTransactionRequest](../../sdk/models/operations/createadjustmenttransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.AdjustmentTransactionResponse](../../sdk/models/shared/adjustmenttransactionresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/attachments/README.md b/sync-for-expenses/docs/sdks/attachments/README.md index 773d8870d..6bd0a48d0 100644 --- a/sync-for-expenses/docs/sdks/attachments/README.md +++ b/sync-for-expenses/docs/sdks/attachments/README.md @@ -1,104 +1,104 @@ -# Attachments - -## Overview - -Attach receipts to a transaction for a complete audit trail. - -### Available Operations - -* [upload](#upload) - Upload attachment - -## upload - -The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. - -[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. - -**Integration-specific behavior** - -Each accounting software supports different file formats and sizes. - -| Integration | File size | File extension | Supported transactions | -|-----------------------------------|-----------|-------------------------------------------------------|------------------------| -| **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | -| **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `expense-transactions.Payment`, `expense-transactions.Refund`, `reimbursable-expense-transactions` | -| **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`expense-transactions.Payment`, `expense-transactions.Refund` | -| **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types -| **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | -| **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` -| **Zoho Books** | 5MB | GIF, PNG, JPEG, JPG, BMP, PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.attachments.upload({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { attachmentsUpload } from "@codat/sync-for-expenses/funcs/attachmentsUpload.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await attachmentsUpload(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("attachmentsUpload failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UploadExpenseAttachmentRequest](../../sdk/models/operations/uploadexpenseattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Attachment](../../sdk/models/shared/attachment.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Attachments + +## Overview + +Attach receipts to a transaction for a complete audit trail. + +### Available Operations + +* [upload](#upload) - Upload attachment + +## upload + +The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. + +[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. + +**Integration-specific behavior** + +Each accounting software supports different file formats and sizes. + +| Integration | File size | File extension | Supported transactions | +|-----------------------------------|-----------|-------------------------------------------------------|------------------------| +| **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | +| **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `expense-transactions.Payment`, `expense-transactions.Refund`, `reimbursable-expense-transactions` | +| **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`expense-transactions.Payment`, `expense-transactions.Refund` | +| **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types +| **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | +| **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` +| **Zoho Books** | 5MB | GIF, PNG, JPEG, JPG, BMP, PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.attachments.upload({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { attachmentsUpload } from "@codat/sync-for-expenses/funcs/attachmentsUpload.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await attachmentsUpload(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("attachmentsUpload failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UploadExpenseAttachmentRequest](../../sdk/models/operations/uploadexpenseattachmentrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Attachment](../../sdk/models/shared/attachment.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/bankaccounts/README.md b/sync-for-expenses/docs/sdks/bankaccounts/README.md index fd3842220..4bc4952e5 100644 --- a/sync-for-expenses/docs/sdks/bankaccounts/README.md +++ b/sync-for-expenses/docs/sdks/bankaccounts/README.md @@ -1,729 +1,729 @@ -# BankAccounts - -## Overview - -Create bank accounts and view create bank account options. - -### Available Operations - -* [create](#create) - Create bank account -* [getCreateModel](#getcreatemodel) - Get create bank account model - -## create - -The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. - -[Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccount: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsCreate } from "@codat/sync-for-expenses/funcs/bankAccountsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccount: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - currency: "GBP", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccount: { - accountName: "GBP Bank Account", - accountType: "Debit", - accountNumber: "12345678", - currency: "GBP", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsCreate } from "@codat/sync-for-expenses/funcs/bankAccountsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccount: { - accountName: "GBP Bank Account", - accountType: "Debit", - accountNumber: "12345678", - currency: "GBP", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccount: { - accountName: "Xero GBP Bank Account", - accountType: "Debit", - sortCode: "445566", - accountNumber: "12345678", - currency: "GBP", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsCreate } from "@codat/sync-for-expenses/funcs/bankAccountsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - bankAccount: { - accountName: "Xero GBP Bank Account", - accountType: "Debit", - sortCode: "445566", - accountNumber: "12345678", - currency: "GBP", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateBankAccountRequest](../../sdk/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateBankAccountResponse](../../sdk/models/shared/createbankaccountresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getCreateModel - -The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. - -[Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - -**Integration-specific behavior** - -See the *response examples* for integration-specific indicative models. - - -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.bankAccounts.getCreateModel({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await bankAccountsGetCreateModel(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("bankAccountsGetCreateModel failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCreateBankAccountsModelRequest](../../sdk/models/operations/getcreatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# BankAccounts + +## Overview + +Create bank accounts and view create bank account options. + +### Available Operations + +* [create](#create) - Create bank account +* [getCreateModel](#getcreatemodel) - Get create bank account model + +## create + +The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. + +[Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccount: { + currency: "GBP", + status: "Active", + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-expenses/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccount: { + currency: "GBP", + status: "Active", + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccount: { + accountName: "GBP Bank Account", + accountType: "Debit", + accountNumber: "12345678", + currency: "GBP", + status: "Active", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-expenses/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccount: { + accountName: "GBP Bank Account", + accountType: "Debit", + accountNumber: "12345678", + currency: "GBP", + status: "Active", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccount: { + accountName: "Xero GBP Bank Account", + accountType: "Debit", + sortCode: "445566", + accountNumber: "12345678", + currency: "GBP", + status: "Active", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsCreate } from "@codat/sync-for-expenses/funcs/bankAccountsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + bankAccount: { + accountName: "Xero GBP Bank Account", + accountType: "Debit", + sortCode: "445566", + accountNumber: "12345678", + currency: "GBP", + status: "Active", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateBankAccountRequest](../../sdk/models/operations/createbankaccountrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateBankAccountResponse](../../sdk/models/shared/createbankaccountresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getCreateModel + +The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. + +[Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. + +**Integration-specific behavior** + +See the *response examples* for integration-specific indicative models. + + +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.bankAccounts.getCreateModel({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { bankAccountsGetCreateModel } from "@codat/sync-for-expenses/funcs/bankAccountsGetCreateModel.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await bankAccountsGetCreateModel(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("bankAccountsGetCreateModel failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCreateBankAccountsModelRequest](../../sdk/models/operations/getcreatebankaccountsmodelrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOption](../../sdk/models/shared/pushoption.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/companies/README.md b/sync-for-expenses/docs/sdks/companies/README.md index 45ba7d15f..fa20f7c9e 100644 --- a/sync-for-expenses/docs/sdks/companies/README.md +++ b/sync-for-expenses/docs/sdks/companies/README.md @@ -1,1050 +1,1050 @@ -# Companies - -## Overview - -Create and manage your SMB users' companies. - -### Available Operations - -* [list](#list) - List companies -* [create](#create) - Create company -* [replace](#replace) - Replace company -* [update](#update) - Update company -* [delete](#delete) - Delete a company -* [get](#get) - Get company - -## list - -The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. - -A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - -## Filter by tags - -The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - -- equals (`=`) -- not equals (`!=`) -- contains (`~`) - -For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: -- Foreign key: `uid = {yourCustomerId}` -- Region: `region != uk` -- Owning team and region: `region = uk && owningTeam = invoice-finance` - -### Example Usage: List of Companies - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesList } from "@codat/sync-for-expenses/funcs/companiesList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatSyncExpenses, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` -### Example Usage: One company - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.list({ - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesList } from "@codat/sync-for-expenses/funcs/companiesList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesList(codatSyncExpenses, { - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - tags: "region=uk && team=invoice-finance", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. - -A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - -If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncExpenses, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a description - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.create({ - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncExpenses, { - name: "Technicalium", - description: "Technology services, including web and app design and development", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With a tag - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.create({ - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncExpenses, { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: With no description - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.create({ - name: "Technicalium", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesCreate(codatSyncExpenses, { - name: "Technicalium", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## replace - -Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - -A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - -### Example Usage: Unauthorized - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesReplace } from "@codat/sync-for-expenses/funcs/companiesReplace.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update description - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesReplace } from "@codat/sync-for-expenses/funcs/companiesReplace.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "Same name", - description: "Additional documents required", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.replace({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesReplace } from "@codat/sync-for-expenses/funcs/companiesReplace.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesReplace(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyRequestBody: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesReplace failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -Use the *Update company* endpoint to update the name, description, or tags of the company. - -The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - -A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - -### Example Usage: Unauthorized - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesUpdate } from "@codat/sync-for-expenses/funcs/companiesUpdate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "Bank of Dave", - description: "Requested early access to the new financing scheme.", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update name - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesUpdate } from "@codat/sync-for-expenses/funcs/companiesUpdate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - name: "New Name", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update tags - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesUpdate } from "@codat/sync-for-expenses/funcs/companiesUpdate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyUpdateRequest: { - tags: { - "refrence": "new reference", - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. - -A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatSyncExpenses.companies.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesDelete } from "@codat/sync-for-expenses/funcs/companiesDelete.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesDelete(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("companiesDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -The *Get company* endpoint returns a single company for a given `companyId`. - -A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. -Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - - -### Example Usage: Parent multi-entity company - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesGet } from "@codat/sync-for-expenses/funcs/companiesGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Simple company - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesGet } from "@codat/sync-for-expenses/funcs/companiesGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Subsidiary multi-entity company - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companies.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companiesGet } from "@codat/sync-for-expenses/funcs/companiesGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companiesGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companiesGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Companies + +## Overview + +Create and manage your SMB users' companies. + +### Available Operations + +* [list](#list) - List companies +* [create](#create) - Create company +* [replace](#replace) - Replace company +* [update](#update) - Update company +* [delete](#delete) - Delete a company +* [get](#get) - Get company + +## list + +The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. + +A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + +## Filter by tags + +The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): + +- equals (`=`) +- not equals (`!=`) +- contains (`~`) + +For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: +- Foreign key: `uid = {yourCustomerId}` +- Region: `region != uk` +- Owning team and region: `region = uk && owningTeam = invoice-finance` + +### Example Usage: List of Companies + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesList } from "@codat/sync-for-expenses/funcs/companiesList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatSyncExpenses, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` +### Example Usage: One company + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.list({ + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesList } from "@codat/sync-for-expenses/funcs/companiesList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesList(codatSyncExpenses, { + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + tags: "region=uk && team=invoice-finance", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCompaniesRequest](../../sdk/models/operations/listcompaniesrequest.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Companies](../../sdk/models/shared/companies.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. + +A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. + +If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncExpenses, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a description + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.create({ + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncExpenses, { + name: "Technicalium", + description: "Technology services, including web and app design and development", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With a tag + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.create({ + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncExpenses, { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: With no description + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.create({ + name: "Technicalium", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesCreate } from "@codat/sync-for-expenses/funcs/companiesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesCreate(codatSyncExpenses, { + name: "Technicalium", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [shared.CompanyRequestBody](../../sdk/models/shared/companyrequestbody.md) | :heavy_minus_sign: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## replace + +Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. + +A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesReplace } from "@codat/sync-for-expenses/funcs/companiesReplace.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update description + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesReplace } from "@codat/sync-for-expenses/funcs/companiesReplace.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "Same name", + description: "Additional documents required", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.replace({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesReplace } from "@codat/sync-for-expenses/funcs/companiesReplace.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesReplace(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyRequestBody: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesReplace failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ReplaceCompanyRequest](../../sdk/models/operations/replacecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +Use the *Update company* endpoint to update the name, description, or tags of the company. + +The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. + +A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesUpdate } from "@codat/sync-for-expenses/funcs/companiesUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "Bank of Dave", + description: "Requested early access to the new financing scheme.", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update name + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesUpdate } from "@codat/sync-for-expenses/funcs/companiesUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + name: "New Name", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update tags + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesUpdate } from "@codat/sync-for-expenses/funcs/companiesUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyUpdateRequest: { + tags: { + "refrence": "new reference", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateCompanyRequest](../../sdk/models/operations/updatecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. + +A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatSyncExpenses.companies.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesDelete } from "@codat/sync-for-expenses/funcs/companiesDelete.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesDelete(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("companiesDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteCompanyRequest](../../sdk/models/operations/deletecompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get company* endpoint returns a single company for a given `companyId`. + +A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. +Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + + +### Example Usage: Parent multi-entity company + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesGet } from "@codat/sync-for-expenses/funcs/companiesGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Simple company + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesGet } from "@codat/sync-for-expenses/funcs/companiesGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Subsidiary multi-entity company + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companies.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companiesGet } from "@codat/sync-for-expenses/funcs/companiesGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companiesGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companiesGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyRequest](../../sdk/models/operations/getcompanyrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Company](../../sdk/models/shared/company.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/companyinfo/README.md b/sync-for-expenses/docs/sdks/companyinfo/README.md index 6e17588f1..6fe88da6e 100644 --- a/sync-for-expenses/docs/sdks/companyinfo/README.md +++ b/sync-for-expenses/docs/sdks/companyinfo/README.md @@ -1,84 +1,84 @@ -# CompanyInfo - -## Overview - -View the company information of your customers' linked accounting software. - -### Available Operations - -* [get](#get) - Get company info - -## get - -Gets the latest basic info for a company. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.companyInfo.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { companyInfoGet } from "@codat/sync-for-expenses/funcs/companyInfoGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await companyInfoGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("companyInfoGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyInfoRequest](../../sdk/models/operations/getcompanyinforequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyInformation](../../sdk/models/shared/companyinformation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# CompanyInfo + +## Overview + +View the company information of your customers' linked accounting software. + +### Available Operations + +* [get](#get) - Get company info + +## get + +Gets the latest basic info for a company. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.companyInfo.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { companyInfoGet } from "@codat/sync-for-expenses/funcs/companyInfoGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await companyInfoGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("companyInfoGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyInfoRequest](../../sdk/models/operations/getcompanyinforequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyInformation](../../sdk/models/shared/companyinformation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/configuration/README.md b/sync-for-expenses/docs/sdks/configuration/README.md index 4cf27ac47..631174329 100644 --- a/sync-for-expenses/docs/sdks/configuration/README.md +++ b/sync-for-expenses/docs/sdks/configuration/README.md @@ -1,174 +1,170 @@ -# Configuration - -## Overview - -View and manage mapping configuration and defaults for expense transactions. - -### Available Operations - -* [get](#get) - Get company configuration -* [set](#set) - Set company configuration - -## get - -Gets a company's expense sync configuration - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.configuration.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { configurationGet } from "@codat/sync-for-expenses/funcs/configurationGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await configurationGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("configurationGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCompanyConfigurationRequest](../../sdk/models/operations/getcompanyconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyConfiguration](../../sdk/models/shared/companyconfiguration.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## set - -Sets a company's expense sync configuration - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.configuration.set({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyConfiguration: { - bankAccount: { - id: "32", - }, - supplier: {}, - customer: {}, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { configurationSet } from "@codat/sync-for-expenses/funcs/configurationSet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await configurationSet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - companyConfiguration: { - bankAccount: { - id: "32", - }, - supplier: {}, - customer: {}, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("configurationSet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.SetCompanyConfigurationRequest](../../sdk/models/operations/setcompanyconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanyConfiguration](../../sdk/models/shared/companyconfiguration.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Configuration + +## Overview + +View and manage mapping configuration and defaults for expense transactions. + +### Available Operations + +* [get](#get) - Get company configuration +* [set](#set) - Set company configuration + +## get + +Gets a company's expense sync configuration + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.configuration.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { configurationGet } from "@codat/sync-for-expenses/funcs/configurationGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await configurationGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("configurationGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCompanyConfigurationRequest](../../sdk/models/operations/getcompanyconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyConfiguration](../../sdk/models/shared/companyconfiguration.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## set + +Sets a company's expense sync configuration + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.configuration.set({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyConfiguration: { + bankAccount: { + id: "32", + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { configurationSet } from "@codat/sync-for-expenses/funcs/configurationSet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await configurationSet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + companyConfiguration: { + bankAccount: { + id: "32", + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("configurationSet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.SetCompanyConfigurationRequest](../../sdk/models/operations/setcompanyconfigurationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanyConfiguration](../../sdk/models/shared/companyconfiguration.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/connections/README.md b/sync-for-expenses/docs/sdks/connections/README.md index 4fd88fa71..373a27952 100644 --- a/sync-for-expenses/docs/sdks/connections/README.md +++ b/sync-for-expenses/docs/sdks/connections/README.md @@ -1,544 +1,544 @@ -# Connections - -## Overview - -Create new and manage existing data connections for a company. - -### Available Operations - -* [list](#list) - List connections -* [create](#create) - Create connection -* [get](#get) - Get connection -* [delete](#delete) - Delete connection -* [unlink](#unlink) - Unlink connection -* [createPartnerExpenseConnection](#createpartnerexpenseconnection) - Create partner expense connection - -## list - -List the connections for a company. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.connections.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsList } from "@codat/sync-for-expenses/funcs/connectionsList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -Creates a connection for the company by providing a valid `platformKey`. - -Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - -### Example Usage: Connection - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsCreate } from "@codat/sync-for-expenses/funcs/connectionsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Unauthorized - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.connections.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsCreate } from "@codat/sync-for-expenses/funcs/connectionsCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: { - platformKey: "gbol", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.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. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.connections.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsGet } from "@codat/sync-for-expenses/funcs/connectionsGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## delete - -Revoke and remove a connection from a company. -This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatSyncExpenses.connections.delete({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsDelete } from "@codat/sync-for-expenses/funcs/connectionsDelete.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsDelete(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("connectionsDelete failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.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. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.connections.unlink({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - status: "Unlinked", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsUnlink } from "@codat/sync-for-expenses/funcs/connectionsUnlink.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsUnlink(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - requestBody: { - status: "Unlinked", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsUnlink failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## createPartnerExpenseConnection - -Creates a partner expense data connection - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.connections.createPartnerExpenseConnection({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { connectionsCreatePartnerExpenseConnection } from "@codat/sync-for-expenses/funcs/connectionsCreatePartnerExpenseConnection.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await connectionsCreatePartnerExpenseConnection(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("connectionsCreatePartnerExpenseConnection failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreatePartnerExpenseConnectionRequest](../../sdk/models/operations/createpartnerexpenseconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Connections + +## Overview + +Create new and manage existing data connections for a company. + +### Available Operations + +* [list](#list) - List connections +* [create](#create) - Create connection +* [get](#get) - Get connection +* [delete](#delete) - Delete connection +* [unlink](#unlink) - Unlink connection +* [createPartnerExpenseConnection](#createpartnerexpenseconnection) - Create partner expense connection + +## list + +List the connections for a company. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.connections.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsList } from "@codat/sync-for-expenses/funcs/connectionsList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListConnectionsRequest](../../sdk/models/operations/listconnectionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connections](../../sdk/models/shared/connections.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +Creates a connection for the company by providing a valid `platformKey`. + +Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + +### Example Usage: Connection + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsCreate } from "@codat/sync-for-expenses/funcs/connectionsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Unauthorized + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.connections.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsCreate } from "@codat/sync-for-expenses/funcs/connectionsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: { + platformKey: "gbol", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateConnectionRequest](../../sdk/models/operations/createconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.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. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.connections.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsGet } from "@codat/sync-for-expenses/funcs/connectionsGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetConnectionRequest](../../sdk/models/operations/getconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## delete + +Revoke and remove a connection from a company. +This operation is not reversible. The end user would need to reauthorize a new data connection if you wish to view new data for this company. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatSyncExpenses.connections.delete({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsDelete } from "@codat/sync-for-expenses/funcs/connectionsDelete.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsDelete(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("connectionsDelete failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.DeleteConnectionRequest](../../sdk/models/operations/deleteconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.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. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.connections.unlink({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: { + status: "Unlinked", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsUnlink } from "@codat/sync-for-expenses/funcs/connectionsUnlink.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsUnlink(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + requestBody: { + status: "Unlinked", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsUnlink failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UnlinkConnectionRequest](../../sdk/models/operations/unlinkconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## createPartnerExpenseConnection + +Creates a partner expense data connection + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.connections.createPartnerExpenseConnection({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { connectionsCreatePartnerExpenseConnection } from "@codat/sync-for-expenses/funcs/connectionsCreatePartnerExpenseConnection.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await connectionsCreatePartnerExpenseConnection(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("connectionsCreatePartnerExpenseConnection failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreatePartnerExpenseConnectionRequest](../../sdk/models/operations/createpartnerexpenseconnectionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Connection](../../sdk/models/shared/connection.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/customers/README.md b/sync-for-expenses/docs/sdks/customers/README.md index 08faa5645..103e066cd 100644 --- a/sync-for-expenses/docs/sdks/customers/README.md +++ b/sync-for-expenses/docs/sdks/customers/README.md @@ -1,2176 +1,2174 @@ -# Customers - -## Overview - -Get, create, and update customers. - -### Available Operations - -* [list](#list) - List customers -* [get](#get) - Get customer -* [create](#create) - Create customer -* [update](#update) - Update customer - -## list - -The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - -[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - -Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - - -### Example Usage: Clear Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreshBooks - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Oracle NetSuite - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 200cloud - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 50 (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Wave - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Zoho Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListCustomersRequest](../../sdk/models/operations/listcustomersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Customers](../../sdk/models/shared/customers.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -The *Get customer* endpoint returns a single customer for a given customerId. - -[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - -Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - - -### Example Usage: Clear Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreshBooks - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Oracle NetSuite - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 200cloud - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 50 (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Wave - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Zoho Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetCustomerRequest](../../sdk/models/operations/getcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Customer](../../sdk/models/shared/customer.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - -[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customer: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Unknown", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Unknown", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersCreate } from "@codat/sync-for-expenses/funcs/customersCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customer: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: null, - status: "Unknown", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Unknown", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateCustomerRequest](../../sdk/models/operations/createcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateCustomerResponse](../../sdk/models/shared/createcustomerresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - -[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.customers.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - customer: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: [ - { - number: "+44 25691 154789", - type: "Primary", - }, - ], - status: "Unknown", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { customersUpdate } from "@codat/sync-for-expenses/funcs/customersUpdate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await customersUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - customer: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - defaultCurrency: "GBP", - contacts: [ - { - phone: [ - { - number: "+44 25691 154789", - type: "Primary", - }, - ], - status: "Unknown", - modifiedDate: "2022-10-23T00:00:00Z", - }, - ], - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("customersUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateCustomerRequest](../../sdk/models/operations/updatecustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.UpdateCustomerResponse](../../sdk/models/shared/updatecustomerresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Customers + +## Overview + +Get, create, and update customers. + +### Available Operations + +* [list](#list) - List customers +* [get](#get) - Get customer +* [create](#create) - Create customer +* [update](#update) - Update customer + +## list + +The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + +[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). + + +### Example Usage: Clear Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreshBooks + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Oracle NetSuite + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 200cloud + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 50 (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Wave + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Zoho Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersList } from "@codat/sync-for-expenses/funcs/customersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListCustomersRequest](../../sdk/models/operations/listcustomersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Customers](../../sdk/models/shared/customers.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get customer* endpoint returns a single customer for a given customerId. + +[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). + + +### Example Usage: Clear Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreshBooks + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Oracle NetSuite + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 200cloud + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 50 (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Wave + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Zoho Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersGet } from "@codat/sync-for-expenses/funcs/customersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetCustomerRequest](../../sdk/models/operations/getcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Customer](../../sdk/models/shared/customer.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + +[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customer: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + defaultCurrency: "GBP", + contacts: [ + { + phone: [ + { + number: "+44 25691 154789", + }, + ], + modifiedDate: "2022-10-23T00:00:00Z", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersCreate } from "@codat/sync-for-expenses/funcs/customersCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customer: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + defaultCurrency: "GBP", + contacts: [ + { + phone: [ + { + number: "+44 25691 154789", + }, + ], + modifiedDate: "2022-10-23T00:00:00Z", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateCustomerRequest](../../sdk/models/operations/createcustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateCustomerResponse](../../sdk/models/shared/createcustomerresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. + +[Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.customers.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + customer: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + defaultCurrency: "GBP", + contacts: [ + { + phone: [ + { + number: "+44 25691 154789", + }, + ], + modifiedDate: "2022-10-23T00:00:00Z", + }, + ], + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { customersUpdate } from "@codat/sync-for-expenses/funcs/customersUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await customersUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + customerId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + customer: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + defaultCurrency: "GBP", + contacts: [ + { + phone: [ + { + number: "+44 25691 154789", + }, + ], + modifiedDate: "2022-10-23T00:00:00Z", + }, + ], + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("customersUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateCustomerRequest](../../sdk/models/operations/updatecustomerrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.UpdateCustomerResponse](../../sdk/models/shared/updatecustomerresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/expenses/README.md b/sync-for-expenses/docs/sdks/expenses/README.md index 884bbe4f7..defa8c61a 100644 --- a/sync-for-expenses/docs/sdks/expenses/README.md +++ b/sync-for-expenses/docs/sdks/expenses/README.md @@ -1,832 +1,700 @@ -# Expenses - -## Overview - -Create and update transactions that represent your customers' spend. - -### Available Operations - -* [create](#create) - Create expense transaction -* [update](#update) - Update expense transactions - -## create - -The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. - -[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| Dynamics 365 Business Central | Yes | -| FreeAgent | Yes | -| QuickBooks Desktop | Yes | -| QuickBooks Online | Yes | -| Oracle NetSuite | Yes | -| Sage Intacct | Yes | -| Xero | Yes | -| Zoho Books | Yes | - - -### Example Usage: Example 1 - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.expenses.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "a44135b0-6882-489a-83fe-a0c57a4afb19", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_3", - }, - {}, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "amazon purchase", - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await expensesCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "a44135b0-6882-489a-83fe-a0c57a4afb19", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_3", - }, - {}, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "amazon purchase", - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("expensesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.expenses.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "a44135b0-6882-489a-83fe-a0c57a4afb19", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_3", - }, - {}, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "amazon purchase", - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await expensesCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "a44135b0-6882-489a-83fe-a0c57a4afb19", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_3", - }, - {}, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "amazon purchase", - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("expensesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Payment - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.expenses.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await expensesCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("expensesCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Refund - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.expenses.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "7008d3f2-aeb4-11ed-afa1-0242ac120002", - type: "Refund", - issueDate: "2024-02-17T00:00:00+00:00", - currency: "GBP", - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "42", - }, - trackingRefs: [ - { - id: "DEPARTMENT_6", - }, - ], - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await expensesCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "7008d3f2-aeb4-11ed-afa1-0242ac120002", - type: "Refund", - issueDate: "2024-02-17T00:00:00+00:00", - currency: "GBP", - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "42", - }, - trackingRefs: [ - { - id: "DEPARTMENT_6", - }, - ], - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("expensesCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateExpenseTransactionRequest](../../sdk/models/operations/createexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateExpenseResponse](../../sdk/models/shared/createexpenseresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. - -[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. - -### Supported integrations -The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: -| Integration | Supported | -|-----------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Desktop | Yes | -| QuickBooks Online | Yes | -| Oracle NetSuite | Yes | -| Sage Intacct | Yes | -| Xero | Yes | -| Zoho Books | Yes | - -#### Integration-specific behavior - -| Integration | Specifics | -|-----------------------|-----------| -| Sage Intacct | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.| - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.expenses.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateExpenseRequest: { - type: "Payment", - issueDate: "2022-06-28T00:00:00.000Z", - currency: "GBP", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - bankAccountRef: { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: null, - trackingRefs: null, - invoiceTo: null, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { expensesUpdate } from "@codat/sync-for-expenses/funcs/expensesUpdate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await expensesUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateExpenseRequest: { - type: "Payment", - issueDate: "2022-06-28T00:00:00.000Z", - currency: "GBP", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - bankAccountRef: { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: null, - trackingRefs: null, - invoiceTo: null, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("expensesUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Payment - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.expenses.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateExpenseRequest: { - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { expensesUpdate } from "@codat/sync-for-expenses/funcs/expensesUpdate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await expensesUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateExpenseRequest: { - type: "Payment", - issueDate: "2024-05-21T00:00:00+00:00", - currency: "GBP", - currencyRate: new Decimal("1"), - contactRef: { - id: "430", - }, - bankAccountRef: { - id: "97", - }, - merchantName: "Amazon UK", - lines: [ - { - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("expensesUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateExpenseTransactionRequest](../../sdk/models/operations/updateexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.UpdateExpenseResponse](../../sdk/models/shared/updateexpenseresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 422, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Expenses + +## Overview + +Create and update transactions that represent your customers' spend. + +### Available Operations + +* [create](#create) - Create expense transaction +* [update](#update) - Update expense transactions + +## create + +The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. + +[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| Dynamics 365 Business Central | Yes | +| FreeAgent | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | +| Sage Intacct | Yes | +| Xero | Yes | +| Zoho Books | Yes | + + +### Example Usage: Example 1 + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.expenses.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await expensesCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("expensesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.expenses.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await expensesCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("expensesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Payment + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.expenses.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "4d7c6929-7770-412b-91bb-44d3bc71d111", + type: "Payment", + issueDate: "2024-05-21T00:00:00+00:00", + currency: "GBP", + currencyRate: 1, + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_5", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await expensesCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "4d7c6929-7770-412b-91bb-44d3bc71d111", + type: "Payment", + issueDate: "2024-05-21T00:00:00+00:00", + currency: "GBP", + currencyRate: 1, + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_5", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("expensesCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Refund + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.expenses.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "7008d3f2-aeb4-11ed-afa1-0242ac120002", + type: "Refund", + issueDate: "2024-02-17T00:00:00+00:00", + currency: "GBP", + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "42", + }, + trackingRefs: [ + { + id: "DEPARTMENT_6", + }, + ], + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { expensesCreate } from "@codat/sync-for-expenses/funcs/expensesCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await expensesCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "7008d3f2-aeb4-11ed-afa1-0242ac120002", + type: "Refund", + issueDate: "2024-02-17T00:00:00+00:00", + currency: "GBP", + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "42", + }, + trackingRefs: [ + { + id: "DEPARTMENT_6", + }, + ], + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("expensesCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateExpenseTransactionRequest](../../sdk/models/operations/createexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateExpenseResponse](../../sdk/models/shared/createexpenseresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. + +[Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. + +### Supported integrations +The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | +| Sage Intacct | Yes | +| Xero | Yes | +| Zoho Books | Yes | + +#### Integration-specific behavior + +| Integration | Specifics | +|-----------------------|-----------| +| Sage Intacct | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.| + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.expenses.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + updateExpenseRequest: { + type: "Payment", + issueDate: "2022-06-28T00:00:00.000Z", + currency: "GBP", + contactRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + type: "Supplier", + }, + bankAccountRef: { + id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + accountRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + itemRef: { + id: "80000002-1675158984", + }, + trackingRefs: [ + { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "80000002-1674552702", + type: "customer", + }, + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { expensesUpdate } from "@codat/sync-for-expenses/funcs/expensesUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await expensesUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + updateExpenseRequest: { + type: "Payment", + issueDate: "2022-06-28T00:00:00.000Z", + currency: "GBP", + contactRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + type: "Supplier", + }, + bankAccountRef: { + id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + accountRef: { + id: "40e3e57c-2322-4898-966c-ca41adfd23fd", + }, + itemRef: { + id: "80000002-1675158984", + }, + trackingRefs: [ + { + id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "80000002-1674552702", + type: "customer", + }, + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("expensesUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Payment + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.expenses.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + updateExpenseRequest: { + type: "Payment", + issueDate: "2024-05-21T00:00:00+00:00", + currency: "GBP", + currencyRate: 1, + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_5", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { expensesUpdate } from "@codat/sync-for-expenses/funcs/expensesUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await expensesUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + updateExpenseRequest: { + type: "Payment", + issueDate: "2024-05-21T00:00:00+00:00", + currency: "GBP", + currencyRate: 1, + contactRef: { + id: "430", + type: "Supplier", + }, + bankAccountRef: { + id: "97", + }, + merchantName: "Amazon UK", + lines: [ + { + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_5", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("expensesUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateExpenseTransactionRequest](../../sdk/models/operations/updateexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.UpdateExpenseResponse](../../sdk/models/shared/updateexpenseresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 422, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/managedata/README.md b/sync-for-expenses/docs/sdks/managedata/README.md index 6d2c36771..b10b0ef1e 100644 --- a/sync-for-expenses/docs/sdks/managedata/README.md +++ b/sync-for-expenses/docs/sdks/managedata/README.md @@ -1,402 +1,400 @@ -# ManageData - -## Overview - -Control and monitor the retrieval of data from an integration. - -### Available Operations - -* [refreshAllDataTypes](#refreshalldatatypes) - Refresh all data -* [get](#get) - Get data status -* [refreshDataType](#refreshdatatype) - Refresh data type -* [listPullOperations](#listpulloperations) - List pull operations -* [getPullOperation](#getpulloperation) - Get pull operation - -## refreshAllDataTypes - -Refreshes all data types with `fetch on first link` set to `true` for a given company. - -This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - -[Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - await codatSyncExpenses.manageData.refreshAllDataTypes({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { manageDataRefreshAllDataTypes } from "@codat/sync-for-expenses/funcs/manageDataRefreshAllDataTypes.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await manageDataRefreshAllDataTypes(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - - } else { - console.log("manageDataRefreshAllDataTypes failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RefreshAllDataTypesRequest](../../sdk/models/operations/refreshalldatatypesrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get the state of each data type for a company - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.manageData.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { manageDataGet } from "@codat/sync-for-expenses/funcs/manageDataGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await manageDataGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("manageDataGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetDataStatusRequest](../../sdk/models/operations/getdatastatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[operations.GetDataStatusDataStatuses](../../sdk/models/operations/getdatastatusdatastatuses.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## refreshDataType - -Refreshes a given data type for a given company. - -This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.manageData.refreshDataType({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - dataType: "invoices", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { manageDataRefreshDataType } from "@codat/sync-for-expenses/funcs/manageDataRefreshDataType.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await manageDataRefreshDataType(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - dataType: "invoices", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("manageDataRefreshDataType failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.RefreshDataTypeRequest](../../sdk/models/operations/refreshdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## listPullOperations - -Gets the pull operation history (datasets) for a given company. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.manageData.listPullOperations({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { manageDataListPullOperations } from "@codat/sync-for-expenses/funcs/manageDataListPullOperations.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await manageDataListPullOperations(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("manageDataListPullOperations failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListPullOperationsRequest](../../sdk/models/operations/listpulloperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperations](../../sdk/models/shared/pulloperations.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getPullOperation - -Retrieve information about a single dataset or pull operation. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.manageData.getPullOperation({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { manageDataGetPullOperation } from "@codat/sync-for-expenses/funcs/manageDataGetPullOperation.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await manageDataGetPullOperation(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - datasetId: "fa5f3e86-bd80-49b8-853c-5fbba4b201f5", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("manageDataGetPullOperation failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetPullOperationRequest](../../sdk/models/operations/getpulloperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# ManageData + +## Overview + +Control and monitor the retrieval of data from an integration. + +### Available Operations + +* [refreshAllDataTypes](#refreshalldatatypes) - Refresh all data +* [get](#get) - Get data status +* [refreshDataType](#refreshdatatype) - Refresh data type +* [listPullOperations](#listpulloperations) - List pull operations +* [getPullOperation](#getpulloperation) - Get pull operation + +## refreshAllDataTypes + +Refreshes all data types with `fetch on first link` set to `true` for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +[Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + await codatSyncExpenses.manageData.refreshAllDataTypes({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { manageDataRefreshAllDataTypes } from "@codat/sync-for-expenses/funcs/manageDataRefreshAllDataTypes.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await manageDataRefreshAllDataTypes(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + + } else { + console.log("manageDataRefreshAllDataTypes failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RefreshAllDataTypesRequest](../../sdk/models/operations/refreshalldatatypesrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get the state of each data type for a company + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.manageData.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { manageDataGet } from "@codat/sync-for-expenses/funcs/manageDataGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await manageDataGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("manageDataGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetDataStatusRequest](../../sdk/models/operations/getdatastatusrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[operations.GetDataStatusDataStatuses](../../sdk/models/operations/getdatastatusdatastatuses.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## refreshDataType + +Refreshes a given data type for a given company. + +This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.manageData.refreshDataType({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + dataType: "invoices", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { manageDataRefreshDataType } from "@codat/sync-for-expenses/funcs/manageDataRefreshDataType.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await manageDataRefreshDataType(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + dataType: "invoices", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("manageDataRefreshDataType failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.RefreshDataTypeRequest](../../sdk/models/operations/refreshdatatyperequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## listPullOperations + +Gets the pull operation history (datasets) for a given company. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.manageData.listPullOperations({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { manageDataListPullOperations } from "@codat/sync-for-expenses/funcs/manageDataListPullOperations.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await manageDataListPullOperations(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("manageDataListPullOperations failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListPullOperationsRequest](../../sdk/models/operations/listpulloperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperations](../../sdk/models/shared/pulloperations.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getPullOperation + +Retrieve information about a single dataset or pull operation. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.manageData.getPullOperation({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { manageDataGetPullOperation } from "@codat/sync-for-expenses/funcs/manageDataGetPullOperation.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await manageDataGetPullOperation(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("manageDataGetPullOperation failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetPullOperationRequest](../../sdk/models/operations/getpulloperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PullOperation](../../sdk/models/shared/pulloperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/mappingoptions/README.md b/sync-for-expenses/docs/sdks/mappingoptions/README.md index 6a5f6047e..b54c9c079 100644 --- a/sync-for-expenses/docs/sdks/mappingoptions/README.md +++ b/sync-for-expenses/docs/sdks/mappingoptions/README.md @@ -1,84 +1,84 @@ -# MappingOptions - -## Overview - -Get accounts, trackingCategories and taxRates that can be used in your create and update requests. - -### Available Operations - -* [getMappingOptions](#getmappingoptions) - Mapping options - -## getMappingOptions - -Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.mappingOptions.getMappingOptions({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { mappingOptionsGetMappingOptions } from "@codat/sync-for-expenses/funcs/mappingOptionsGetMappingOptions.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await mappingOptionsGetMappingOptions(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("mappingOptionsGetMappingOptions failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetMappingOptionsRequest](../../sdk/models/operations/getmappingoptionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.MappingOptions](../../sdk/models/shared/mappingoptions.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# MappingOptions + +## Overview + +Get accounts, trackingCategories and taxRates that can be used in your create and update requests. + +### Available Operations + +* [getMappingOptions](#getmappingoptions) - Mapping options + +## getMappingOptions + +Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.mappingOptions.getMappingOptions({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { mappingOptionsGetMappingOptions } from "@codat/sync-for-expenses/funcs/mappingOptionsGetMappingOptions.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await mappingOptionsGetMappingOptions(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("mappingOptionsGetMappingOptions failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetMappingOptionsRequest](../../sdk/models/operations/getmappingoptionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.MappingOptions](../../sdk/models/shared/mappingoptions.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/pushoperations/README.md b/sync-for-expenses/docs/sdks/pushoperations/README.md index d6ecb414c..110595913 100644 --- a/sync-for-expenses/docs/sdks/pushoperations/README.md +++ b/sync-for-expenses/docs/sdks/pushoperations/README.md @@ -1,166 +1,164 @@ -# PushOperations - -## Overview - -View historic push operations. - -### Available Operations - -* [list](#list) - List push operations -* [get](#get) - Get push operation - -## list - -List push operation records. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.pushOperations.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { pushOperationsList } from "@codat/sync-for-expenses/funcs/pushOperationsList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await pushOperationsList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("pushOperationsList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListPushOperationsRequest](../../sdk/models/operations/listpushoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOperations](../../sdk/models/shared/pushoperations.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Retrieve push operation. - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.pushOperations.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { pushOperationsGet } from "@codat/sync-for-expenses/funcs/pushOperationsGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await pushOperationsGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - pushOperationKey: "660e8684-c0fb-4468-9e2a-b2e3b115d747", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("pushOperationsGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetPushOperationRequest](../../sdk/models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.PushOperation](../../sdk/models/shared/pushoperation.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# PushOperations + +## Overview + +View historic push operations. + +### Available Operations + +* [list](#list) - List push operations +* [get](#get) - Get push operation + +## list + +List push operation records. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.pushOperations.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { pushOperationsList } from "@codat/sync-for-expenses/funcs/pushOperationsList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await pushOperationsList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("pushOperationsList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListPushOperationsRequest](../../sdk/models/operations/listpushoperationsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOperations](../../sdk/models/shared/pushoperations.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Retrieve push operation. + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.pushOperations.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { pushOperationsGet } from "@codat/sync-for-expenses/funcs/pushOperationsGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await pushOperationsGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("pushOperationsGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetPushOperationRequest](../../sdk/models/operations/getpushoperationrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.PushOperation](../../sdk/models/shared/pushoperation.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/reimbursements/README.md b/sync-for-expenses/docs/sdks/reimbursements/README.md index b9fe2d56e..d8c197ed7 100644 --- a/sync-for-expenses/docs/sdks/reimbursements/README.md +++ b/sync-for-expenses/docs/sdks/reimbursements/README.md @@ -1,836 +1,464 @@ -# Reimbursements - -## Overview - -Create and update transactions that represent your customers' repayable spend. - -### Available Operations - -* [create](#create) - Create reimbursable expense transaction -* [update](#update) - Update reimbursable expense transaction - -## create - -Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. - -[Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). - -### Supported Integrations -| Integration | Supported | -|-----------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Desktop | Yes | -| QuickBooks Online | Yes | -| Oracle NetSuite | Yes | -| Zoho Books | Yes | -| Sage Intacct | Yes | - -### Example Usage: Create reimbursable expense - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.reimbursements.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - reference: "expenses w/c 01/07", - contactRef: { - id: "752", - }, - issueDate: "2024-05-21", - dueDate: "2024-05-21", - currency: "GBP", - currencyRate: new Decimal("1"), - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "Hotel", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { reimbursementsCreate } from "@codat/sync-for-expenses/funcs/reimbursementsCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await reimbursementsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - reference: "expenses w/c 01/07", - contactRef: { - id: "752", - }, - issueDate: "2024-05-21", - dueDate: "2024-05-21", - currency: "GBP", - currencyRate: new Decimal("1"), - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "Hotel", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("reimbursementsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Example 1 - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.reimbursements.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: null, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { reimbursementsCreate } from "@codat/sync-for-expenses/funcs/reimbursementsCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await reimbursementsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: null, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("reimbursementsCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.reimbursements.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: null, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - ], - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { reimbursementsCreate } from "@codat/sync-for-expenses/funcs/reimbursementsCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await reimbursementsCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - requestBody: [ - { - id: "4d7c6929-7770-412b-91bb-44d3bc71d111", - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: null, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - ], - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("reimbursementsCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateReimbursableExpenseTransactionRequest](../../sdk/models/operations/createreimbursableexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateReimbursableExpenseResponse](../../sdk/models/shared/createreimbursableexpenseresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. - -Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). - -### Supported Integrations -| Integration | Supported | -|-----------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Oracle NetSuite | Yes | -| Zoho Books | Yes | - - - -### Example Usage: Example 1 - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.reimbursements.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateReimbursableExpenseTransactionRequest: { - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: { - id: "8000004C-1724173136", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { reimbursementsUpdate } from "@codat/sync-for-expenses/funcs/reimbursementsUpdate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await reimbursementsUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateReimbursableExpenseTransactionRequest: { - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: { - id: "8000004C-1724173136", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("reimbursementsUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.reimbursements.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateReimbursableExpenseTransactionRequest: { - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: { - id: "8000004C-1724173136", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { reimbursementsUpdate } from "@codat/sync-for-expenses/funcs/reimbursementsUpdate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await reimbursementsUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateReimbursableExpenseTransactionRequest: { - contactRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - apAccountRef: { - id: "8000004C-1724173136", - }, - issueDate: "2022-10-23T00:00:00Z", - dueDate: "2022-10-23T00:00:00Z", - currency: "GBP", - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "2-night hotel stay", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - accountRef: { - id: "40e3e57c-2322-4898-966c-ca41adfd23fd", - }, - itemRef: { - id: "80000002-1675158984", - }, - trackingRefs: [ - { - id: "e9a1b63d-9ff0-40e7-8038-016354b987e6", - }, - ], - invoiceTo: { - id: "80000002-1674552702", - type: "customer", - }, - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("reimbursementsUpdate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Update reimbursable expense - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.reimbursements.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateReimbursableExpenseTransactionRequest: { - reference: "expenses w/c 01/07", - contactRef: { - id: "752", - }, - issueDate: "2024-05-21", - dueDate: "2024-05-21", - currency: "GBP", - currencyRate: new Decimal("1"), - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "Hotel", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { reimbursementsUpdate } from "@codat/sync-for-expenses/funcs/reimbursementsUpdate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await reimbursementsUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - updateReimbursableExpenseTransactionRequest: { - reference: "expenses w/c 01/07", - contactRef: { - id: "752", - }, - issueDate: "2024-05-21", - dueDate: "2024-05-21", - currency: "GBP", - currencyRate: new Decimal("1"), - notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", - lines: [ - { - description: "Hotel", - netAmount: new Decimal("100"), - taxAmount: new Decimal("20"), - taxRateRef: { - id: "23_Bills", - }, - accountRef: { - id: "35", - }, - trackingRefs: [ - { - id: "DEPARTMENT_5", - }, - ], - invoiceTo: { - id: "504", - type: "customer", - }, - }, - ], - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("reimbursementsUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateReimbursableExpenseTransactionRequest](../../sdk/models/operations/updatereimbursableexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateReimbursableExpenseResponse](../../sdk/models/shared/createreimbursableexpenseresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Reimbursements + +## Overview + +Create and update transactions that represent your customers' repayable spend. + +### Available Operations + +* [create](#create) - Create reimbursable expense transaction +* [update](#update) - Update reimbursable expense transaction + +## create + +Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. + +[Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). + +### Supported Integrations +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | +| Zoho Books | Yes | +| Sage Intacct | Yes | + +### Example Usage: Create reimbursable expense + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.reimbursements.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "4d7c6929-7770-412b-91bb-44d3bc71d111", + reference: "expenses w/c 01/07", + contactRef: { + id: "752", + }, + issueDate: "2024-05-21", + dueDate: "2024-05-21", + currency: "GBP", + currencyRate: 1, + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + lines: [ + { + description: "Hotel", + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_5", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + }, + ], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { reimbursementsCreate } from "@codat/sync-for-expenses/funcs/reimbursementsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await reimbursementsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [ + { + id: "4d7c6929-7770-412b-91bb-44d3bc71d111", + reference: "expenses w/c 01/07", + contactRef: { + id: "752", + }, + issueDate: "2024-05-21", + dueDate: "2024-05-21", + currency: "GBP", + currencyRate: 1, + notes: "APPLE.COM/BILL - 09001077498 - Card Ending: 4590", + lines: [ + { + description: "Hotel", + netAmount: 100, + taxAmount: 20, + taxRateRef: { + id: "23_Bills", + }, + accountRef: { + id: "35", + }, + trackingRefs: [ + { + id: "DEPARTMENT_5", + dataType: "trackingCategories", + }, + ], + invoiceTo: { + id: "504", + type: "customer", + }, + }, + ], + }, + ], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("reimbursementsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Example 1 + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.reimbursements.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { reimbursementsCreate } from "@codat/sync-for-expenses/funcs/reimbursementsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await reimbursementsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("reimbursementsCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.reimbursements.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { reimbursementsCreate } from "@codat/sync-for-expenses/funcs/reimbursementsCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await reimbursementsCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + requestBody: [], + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("reimbursementsCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateReimbursableExpenseTransactionRequest](../../sdk/models/operations/createreimbursableexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateReimbursableExpenseResponse](../../sdk/models/shared/createreimbursableexpenseresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. + +Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). + +### Supported Integrations +| Integration | Supported | +|-----------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Oracle NetSuite | Yes | +| Zoho Books | Yes | + + + +### Example Usage: Example 1 + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.reimbursements.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { reimbursementsUpdate } from "@codat/sync-for-expenses/funcs/reimbursementsUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await reimbursementsUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("reimbursementsUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.reimbursements.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { reimbursementsUpdate } from "@codat/sync-for-expenses/funcs/reimbursementsUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await reimbursementsUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("reimbursementsUpdate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Update reimbursable expense + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.reimbursements.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { reimbursementsUpdate } from "@codat/sync-for-expenses/funcs/reimbursementsUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await reimbursementsUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("reimbursementsUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateReimbursableExpenseTransactionRequest](../../sdk/models/operations/updatereimbursableexpensetransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateReimbursableExpenseResponse](../../sdk/models/shared/createreimbursableexpenseresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/suppliers/README.md b/sync-for-expenses/docs/sdks/suppliers/README.md index 72498acb8..e417fdd10 100644 --- a/sync-for-expenses/docs/sdks/suppliers/README.md +++ b/sync-for-expenses/docs/sdks/suppliers/README.md @@ -1,2378 +1,2382 @@ -# Suppliers - -## Overview - -Get, create, and update suppliers. - -### Available Operations - -* [list](#list) - List suppliers -* [get](#get) - Get supplier -* [create](#create) - Create supplier -* [update](#update) - Update supplier - -## list - -The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| Dynamics 365 Business Central | Yes | -| FreeAgent | Yes | -| Oracle NetSuite | Yes | -| QuickBooks Desktop | Yes | -| QuickBooks Online | Yes | -| Sage Intacct | Yes | -| Xero | Yes | -| Zoho Books | Yes | - - -### Example Usage: Clear Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreshBooks - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Oracle NetSuite - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 200cloud - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 50 (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Wave - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` -### Example Usage: Zoho Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", - orderBy: "-modifiedDate", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListSuppliersRequest](../../sdk/models/operations/listsuppliersrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Suppliers](../../sdk/models/shared/suppliers.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| --------------------------------- | --------------------------------- | --------------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -The *Get supplier* endpoint returns a single supplier for a given supplierId. - -[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| Dynamics 365 Business Central | Yes | -| FreeAgent | Yes | -| Oracle NetSuite | Yes | -| QuickBooks Desktop | Yes | -| QuickBooks Online | Yes | -| Sage Intacct | Yes | -| Xero | Yes | -| Zoho Books | Yes | - - -### Example Usage: Clear Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Dynamics 365 Business Central - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (Netherlands) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Exact (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreeAgent - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: FreshBooks - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: KashFlow - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Oracle NetSuite - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Desktop - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: QuickBooks Online Sandbox - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 200cloud - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage 50 (UK) - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Business Cloud Accounting - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Wave - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Xero - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` -### Example Usage: Zoho Books - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSupplierRequest](../../sdk/models/operations/getsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Supplier](../../sdk/models/shared/supplier.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## create - -The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - -### Supported Integrations - -| Integration | Supported | -|-------------------------------|-----------| -| Dynamics 365 Business Central | Yes | -| FreeAgent | Yes | -| Oracle NetSuite | Yes | -| QuickBooks Desktop | Yes | -| QuickBooks Online | Yes | -| Sage Intacct | Yes | -| Xero | Yes | -| Zoho Books | Yes | - - -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplier: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersCreate } from "@codat/sync-for-expenses/funcs/suppliersCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplier: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Sage Intacct - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplier: { - id: "73593", - supplierName: "test 20230420 1004", - contactName: "Joe Bloggs", - status: "Active", - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersCreate } from "@codat/sync-for-expenses/funcs/suppliersCreate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplier: { - id: "73593", - supplierName: "test 20230420 1004", - contactName: "Joe Bloggs", - status: "Active", - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateSupplierRequest](../../sdk/models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CreateSupplierResponse](../../sdk/models/shared/createsupplierresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## update - -The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - -[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - -**Integration-specific behavior** - -Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - -### Supported Integrations - -| Integration | Supported | -|-------------------|-----------| -| FreeAgent | Yes | -| QuickBooks Online | Yes | -| Xero | Yes | - - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.suppliers.update({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplier: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { suppliersUpdate } from "@codat/sync-for-expenses/funcs/suppliersUpdate.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await suppliersUpdate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", - supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", - supplier: { - modifiedDate: "2022-10-23T00:00:00Z", - sourceModifiedDate: "2022-10-23T00:00:00Z", - 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", - }, - ], - registrationNumber: "string", - taxNumber: "string", - status: "Unknown", - defaultCurrency: "string", - metadata: { - isDeleted: true, - }, - supplementalData: { - content: { - "property1": { - "property1": "", - "property2": "", - }, - "property2": { - "property1": "", - "property2": "", - }, - }, - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("suppliersUpdate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.UpdateSupplierRequest](../../sdk/models/operations/updatesupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.UpdateSupplierResponse](../../sdk/models/shared/updatesupplierresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Suppliers + +## Overview + +Get, create, and update suppliers. + +### Available Operations + +* [list](#list) - List suppliers +* [get](#get) - Get supplier +* [create](#create) - Create supplier +* [update](#update) - Update supplier + +## list + +The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| Dynamics 365 Business Central | Yes | +| FreeAgent | Yes | +| Oracle NetSuite | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Sage Intacct | Yes | +| Xero | Yes | +| Zoho Books | Yes | + + +### Example Usage: Clear Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreshBooks + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Oracle NetSuite + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 200cloud + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 50 (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Wave + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` +### Example Usage: Zoho Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersList } from "@codat/sync-for-expenses/funcs/suppliersList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + query: "id=e3334455-1aed-4e71-ab43-6bccf12092ee", + orderBy: "-modifiedDate", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListSuppliersRequest](../../sdk/models/operations/listsuppliersrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Suppliers](../../sdk/models/shared/suppliers.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| --------------------------------- | --------------------------------- | --------------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +The *Get supplier* endpoint returns a single supplier for a given supplierId. + +[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| Dynamics 365 Business Central | Yes | +| FreeAgent | Yes | +| Oracle NetSuite | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Sage Intacct | Yes | +| Xero | Yes | +| Zoho Books | Yes | + + +### Example Usage: Clear Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Dynamics 365 Business Central + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (Netherlands) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Exact (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreeAgent + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: FreshBooks + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: KashFlow + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Oracle NetSuite + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Desktop + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: QuickBooks Online Sandbox + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 200cloud + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage 50 (UK) + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Business Cloud Accounting + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Wave + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Xero + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` +### Example Usage: Zoho Books + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersGet } from "@codat/sync-for-expenses/funcs/suppliersGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetSupplierRequest](../../sdk/models/operations/getsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Supplier](../../sdk/models/shared/supplier.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 409, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## create + +The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). + +### Supported Integrations + +| Integration | Supported | +|-------------------------------|-----------| +| Dynamics 365 Business Central | Yes | +| FreeAgent | Yes | +| Oracle NetSuite | Yes | +| QuickBooks Desktop | Yes | +| QuickBooks Online | Yes | +| Sage Intacct | Yes | +| Xero | Yes | +| Zoho Books | Yes | + + +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplier: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersCreate } from "@codat/sync-for-expenses/funcs/suppliersCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplier: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Sage Intacct + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplier: { + id: "73593", + supplierName: "test 20230420 1004", + contactName: "Joe Bloggs", + status: "Active", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersCreate } from "@codat/sync-for-expenses/funcs/suppliersCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplier: { + id: "73593", + supplierName: "test 20230420 1004", + contactName: "Joe Bloggs", + status: "Active", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateSupplierRequest](../../sdk/models/operations/createsupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CreateSupplierResponse](../../sdk/models/shared/createsupplierresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## update + +The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. + +[Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. + +**Integration-specific behavior** + +Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). + +### Supported Integrations + +| Integration | Supported | +|-------------------|-----------| +| FreeAgent | Yes | +| QuickBooks Online | Yes | +| Xero | Yes | + + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.suppliers.update({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplier: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { suppliersUpdate } from "@codat/sync-for-expenses/funcs/suppliersUpdate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await suppliersUpdate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + connectionId: "2e9d2c44-f675-40ba-8049-353bfcb5e171", + supplierId: "13d946f0-c5d5-42bc-b092-97ece17923ab", + supplier: { + modifiedDate: "2022-10-23T00:00:00Z", + sourceModifiedDate: "2022-10-23T00:00:00Z", + 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": "None", + "property2": "None", + }, + "property2": { + "property1": "None", + "property2": "None", + }, + }, + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("suppliersUpdate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.UpdateSupplierRequest](../../sdk/models/operations/updatesupplierrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.UpdateSupplierResponse](../../sdk/models/shared/updatesupplierresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/sync/README.md b/sync-for-expenses/docs/sdks/sync/README.md index 98c55ce05..8d3c38bc1 100644 --- a/sync-for-expenses/docs/sdks/sync/README.md +++ b/sync-for-expenses/docs/sdks/sync/README.md @@ -1,314 +1,314 @@ -# Sync - -## Overview - -Monitor the status of data syncs. - -### Available Operations - -* [getLastSuccessfulSync](#getlastsuccessfulsync) - Last successful sync -* [getLatestSync](#getlatestsync) - Latest sync status -* [list](#list) - List sync statuses -* [get](#get) - Get sync status - -## getLastSuccessfulSync - -Gets the status of the last successful sync - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.sync.getLastSuccessfulSync({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { syncGetLastSuccessfulSync } from "@codat/sync-for-expenses/funcs/syncGetLastSuccessfulSync.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await syncGetLastSuccessfulSync(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("syncGetLastSuccessfulSync failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetLastSuccessfulSyncRequest](../../sdk/models/operations/getlastsuccessfulsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanySyncStatus](../../sdk/models/shared/companysyncstatus.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## getLatestSync - -Gets the latest sync status - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.sync.getLatestSync({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { syncGetLatestSync } from "@codat/sync-for-expenses/funcs/syncGetLatestSync.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await syncGetLatestSync(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("syncGetLatestSync failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetLatestSyncRequest](../../sdk/models/operations/getlatestsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanySyncStatus](../../sdk/models/shared/companysyncstatus.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## list - -Gets a list of sync statuses - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.sync.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { syncList } from "@codat/sync-for-expenses/funcs/syncList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await syncList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("syncList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListSyncsRequest](../../sdk/models/operations/listsyncsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanySyncStatus[]](../../models/.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Get the sync status for a specified sync - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.sync.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { syncGet } from "@codat/sync-for-expenses/funcs/syncGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await syncGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("syncGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSyncByIdRequest](../../sdk/models/operations/getsyncbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.CompanySyncStatus](../../sdk/models/shared/companysyncstatus.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Sync + +## Overview + +Monitor the status of data syncs. + +### Available Operations + +* [getLastSuccessfulSync](#getlastsuccessfulsync) - Last successful sync +* [getLatestSync](#getlatestsync) - Latest sync status +* [list](#list) - List sync statuses +* [get](#get) - Get sync status + +## getLastSuccessfulSync + +Gets the status of the last successful sync + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.sync.getLastSuccessfulSync({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { syncGetLastSuccessfulSync } from "@codat/sync-for-expenses/funcs/syncGetLastSuccessfulSync.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await syncGetLastSuccessfulSync(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("syncGetLastSuccessfulSync failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLastSuccessfulSyncRequest](../../sdk/models/operations/getlastsuccessfulsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanySyncStatus](../../sdk/models/shared/companysyncstatus.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## getLatestSync + +Gets the latest sync status + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.sync.getLatestSync({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { syncGetLatestSync } from "@codat/sync-for-expenses/funcs/syncGetLatestSync.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await syncGetLatestSync(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("syncGetLatestSync failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetLatestSyncRequest](../../sdk/models/operations/getlatestsyncrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanySyncStatus](../../sdk/models/shared/companysyncstatus.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## list + +Gets a list of sync statuses + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.sync.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { syncList } from "@codat/sync-for-expenses/funcs/syncList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await syncList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("syncList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListSyncsRequest](../../sdk/models/operations/listsyncsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanySyncStatus[]](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Get the sync status for a specified sync + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.sync.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { syncGet } from "@codat/sync-for-expenses/funcs/syncGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await syncGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("syncGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetSyncByIdRequest](../../sdk/models/operations/getsyncbyidrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.CompanySyncStatus](../../sdk/models/shared/companysyncstatus.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/transactionstatus/README.md b/sync-for-expenses/docs/sdks/transactionstatus/README.md index 05eb6e943..538c98633 100644 --- a/sync-for-expenses/docs/sdks/transactionstatus/README.md +++ b/sync-for-expenses/docs/sdks/transactionstatus/README.md @@ -1,166 +1,166 @@ -# TransactionStatus - -## Overview - -Monitor the status of individual transactions in data syncs. - -### Available Operations - -* [list](#list) - List sync transactions -* [get](#get) - Get sync transaction - -## list - -Gets the transactions and status for a sync - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.transactionStatus.list({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { transactionStatusList } from "@codat/sync-for-expenses/funcs/transactionStatusList.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionStatusList(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionStatusList failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.ListSyncTransactionsRequest](../../sdk/models/operations/listsynctransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Transactions](../../sdk/models/shared/transactions.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | -| errors.SDKError | 4XX, 5XX | \*/\* | - -## get - -Gets the status of a transaction for a sync - -### Example Usage - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.transactionStatus.get({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { transactionStatusGet } from "@codat/sync-for-expenses/funcs/transactionStatusGet.js"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transactionStatusGet(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transactionStatusGet failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.GetSyncTransactionRequest](../../sdk/models/operations/getsynctransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.Transaction[]](../../models/.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ----------------------- | ----------------------- | ----------------------- | -| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# TransactionStatus + +## Overview + +Monitor the status of individual transactions in data syncs. + +### Available Operations + +* [list](#list) - List sync transactions +* [get](#get) - Get sync transaction + +## list + +Gets the transactions and status for a sync + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.transactionStatus.list({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { transactionStatusList } from "@codat/sync-for-expenses/funcs/transactionStatusList.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionStatusList(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionStatusList failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.ListSyncTransactionsRequest](../../sdk/models/operations/listsynctransactionsrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Transactions](../../sdk/models/shared/transactions.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | +| errors.SDKError | 4XX, 5XX | \*/\* | + +## get + +Gets the status of a transaction for a sync + +### Example Usage + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.transactionStatus.get({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { transactionStatusGet } from "@codat/sync-for-expenses/funcs/transactionStatusGet.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transactionStatusGet(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + syncId: "6fb40d5e-b13e-11ed-afa1-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transactionStatusGet failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.GetSyncTransactionRequest](../../sdk/models/operations/getsynctransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.Transaction[]](../../models/.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ----------------------- | ----------------------- | ----------------------- | +| errors.ErrorMessage | 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/docs/sdks/transfers/README.md b/sync-for-expenses/docs/sdks/transfers/README.md index 40a9011b4..50251396f 100644 --- a/sync-for-expenses/docs/sdks/transfers/README.md +++ b/sync-for-expenses/docs/sdks/transfers/README.md @@ -1,306 +1,252 @@ -# Transfers - -## Overview - -Create and update transactions that represent the movement of your customers' money. - -### Available Operations - -* [create](#create) - Create transfer transaction - -## create - -Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. - -Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. - -The `from.amount` and `to.amount` fields are in the native currency of the account. - -### Supported Integrations -| Integration | Create transfer | Update transfer | -|-----------------------|------------------|------------------| -| Dynamics | No | No | -| FreeAgent | Yes | Yes | -| NetSuite | No | No | -| QuickBooks Desktop | Yes | No | -| QuickBooks Online | Yes | Yes | -| Sage Intacct | No | No | -| Xero | Yes | No | -| Zoho Books | No | No | - -### Example Usage: Create transfer - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.transfers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - transferTransactionRequest: { - description: "Sample transfer description", - date: "2021-05-21T00:00:00+00:00", - from: { - accountRef: { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", - }, - amount: new Decimal("100"), - }, - to: { - accountRef: { - id: "777dfb37-5506-3dc0-6g86-8d34z4cc78ea", - }, - amount: new Decimal("100"), - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { transfersCreate } from "@codat/sync-for-expenses/funcs/transfersCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transfersCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - transferTransactionRequest: { - description: "Sample transfer description", - date: "2021-05-21T00:00:00+00:00", - from: { - accountRef: { - id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", - }, - amount: new Decimal("100"), - }, - to: { - accountRef: { - id: "777dfb37-5506-3dc0-6g86-8d34z4cc78ea", - }, - amount: new Decimal("100"), - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transfersCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Example 1 - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.transfers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - transferTransactionRequest: { - description: "Transfer from bank account Y to bank account Z", - date: "2022-10-23T00:00:00Z", - from: { - accountRef: { - id: "", - }, - amount: new Decimal("7329.18"), - }, - to: { - accountRef: { - id: "", - }, - amount: new Decimal("522.15"), - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { transfersCreate } from "@codat/sync-for-expenses/funcs/transfersCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transfersCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - transferTransactionRequest: { - description: "Transfer from bank account Y to bank account Z", - date: "2022-10-23T00:00:00Z", - from: { - accountRef: { - id: "", - }, - amount: new Decimal("7329.18"), - }, - to: { - accountRef: { - id: "", - }, - amount: new Decimal("522.15"), - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transfersCreate failed:", res.error); - } -} - -run(); -``` -### Example Usage: Malformed query - - -```typescript -import { CodatSyncExpenses } from "@codat/sync-for-expenses"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -const codatSyncExpenses = new CodatSyncExpenses({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const result = await codatSyncExpenses.transfers.create({ - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - transferTransactionRequest: { - description: "Transfer from bank account Y to bank account Z", - date: "2022-10-23T00:00:00Z", - from: { - accountRef: { - id: "", - }, - amount: new Decimal("7329.18"), - }, - to: { - accountRef: { - id: "", - }, - amount: new Decimal("522.15"), - }, - }, - }); - - console.log(result); -} - -run(); -``` - -### Standalone function - -The standalone function version of this method: - -```typescript -import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; -import { transfersCreate } from "@codat/sync-for-expenses/funcs/transfersCreate.js"; -import { Decimal } from "@codat/sync-for-expenses/sdk/types"; - -// Use `CodatSyncExpensesCore` for best tree-shaking performance. -// You can create one instance of it to use across an application. -const codatSyncExpenses = new CodatSyncExpensesCore({ - authHeader: "Basic BASE_64_ENCODED(API_KEY)", -}); - -async function run() { - const res = await transfersCreate(codatSyncExpenses, { - companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", - transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", - transferTransactionRequest: { - description: "Transfer from bank account Y to bank account Z", - date: "2022-10-23T00:00:00Z", - from: { - accountRef: { - id: "", - }, - amount: new Decimal("7329.18"), - }, - to: { - accountRef: { - id: "", - }, - amount: new Decimal("522.15"), - }, - }, - }); - if (res.ok) { - const { value: result } = res; - console.log(result); - } else { - console.log("transfersCreate failed:", res.error); - } -} - -run(); -``` - -### Parameters - -| Parameter | Type | Required | Description | -| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -| `request` | [operations.CreateTransferTransactionRequest](../../sdk/models/operations/createtransfertransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | -| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | -| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | -| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | - -### Response - -**Promise\<[shared.TransferTransactionResponse](../../sdk/models/shared/transfertransactionresponse.md)\>** - -### Errors - -| Error Type | Status Code | Content Type | -| ---------------------------- | ---------------------------- | ---------------------------- | -| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | -| errors.ErrorMessage | 500, 503 | application/json | +# Transfers + +## Overview + +Create and update transactions that represent the movement of your customers' money. + +### Available Operations + +* [create](#create) - Create transfer transaction + +## create + +Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. + +Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. + +The `from.amount` and `to.amount` fields are in the native currency of the account. + +### Supported Integrations +| Integration | Create transfer | Update transfer | +|-----------------------|------------------|------------------| +| Dynamics | No | No | +| FreeAgent | Yes | Yes | +| NetSuite | No | No | +| QuickBooks Desktop | Yes | No | +| QuickBooks Online | Yes | Yes | +| Sage Intacct | No | No | +| Xero | Yes | No | +| Zoho Books | No | No | + +### Example Usage: Create transfer + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.transfers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + transferTransactionRequest: { + description: "Sample transfer description", + date: "2021-05-21T00:00:00+00:00", + from: { + accountRef: { + id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", + }, + amount: 100, + }, + to: { + accountRef: { + id: "777dfb37-5506-3dc0-6g86-8d34z4cc78ea", + }, + amount: 100, + }, + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { transfersCreate } from "@codat/sync-for-expenses/funcs/transfersCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transfersCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + transferTransactionRequest: { + description: "Sample transfer description", + date: "2021-05-21T00:00:00+00:00", + from: { + accountRef: { + id: "787dfb37-5707-4dc0-8a86-8d74e4cc78ea", + }, + amount: 100, + }, + to: { + accountRef: { + id: "777dfb37-5506-3dc0-6g86-8d34z4cc78ea", + }, + amount: 100, + }, + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transfersCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Example 1 + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.transfers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + transferTransactionRequest: { + description: "Transfer from bank account Y to bank account Z", + date: "2022-10-23T00:00:00Z", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { transfersCreate } from "@codat/sync-for-expenses/funcs/transfersCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transfersCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + transferTransactionRequest: { + description: "Transfer from bank account Y to bank account Z", + date: "2022-10-23T00:00:00Z", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transfersCreate failed:", res.error); + } +} + +run(); +``` +### Example Usage: Malformed query + + +```typescript +import { CodatSyncExpenses } from "@codat/sync-for-expenses"; + +const codatSyncExpenses = new CodatSyncExpenses({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const result = await codatSyncExpenses.transfers.create({ + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + transferTransactionRequest: { + description: "Transfer from bank account Y to bank account Z", + date: "2022-10-23T00:00:00Z", + }, + }); + + console.log(result); +} + +run(); +``` + +### Standalone function + +The standalone function version of this method: + +```typescript +import { CodatSyncExpensesCore } from "@codat/sync-for-expenses/core.js"; +import { transfersCreate } from "@codat/sync-for-expenses/funcs/transfersCreate.js"; + +// Use `CodatSyncExpensesCore` for best tree-shaking performance. +// You can create one instance of it to use across an application. +const codatSyncExpenses = new CodatSyncExpensesCore({ + authHeader: "Basic BASE_64_ENCODED(API_KEY)", +}); + +async function run() { + const res = await transfersCreate(codatSyncExpenses, { + companyId: "8a210b68-6988-11ed-a1eb-0242ac120002", + transactionId: "336694d8-2dca-4cb5-a28d-3ccb83e55eee", + transferTransactionRequest: { + description: "Transfer from bank account Y to bank account Z", + date: "2022-10-23T00:00:00Z", + }, + }); + if (res.ok) { + const { value: result } = res; + console.log(result); + } else { + console.log("transfersCreate failed:", res.error); + } +} + +run(); +``` + +### Parameters + +| Parameter | Type | Required | Description | +| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `request` | [operations.CreateTransferTransactionRequest](../../sdk/models/operations/createtransfertransactionrequest.md) | :heavy_check_mark: | The request object to use for the request. | +| `options` | RequestOptions | :heavy_minus_sign: | Used to set various options for making HTTP requests. | +| `options.fetchOptions` | [RequestInit](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options) | :heavy_minus_sign: | Options that are passed to the underlying HTTP request. This can be used to inject extra headers for examples. All `Request` options, except `method` and `body`, are allowed. | +| `options.retries` | [RetryConfig](../../lib/utils/retryconfig.md) | :heavy_minus_sign: | Enables retrying HTTP requests under certain failure conditions. | + +### Response + +**Promise\<[shared.TransferTransactionResponse](../../sdk/models/shared/transfertransactionresponse.md)\>** + +### Errors + +| Error Type | Status Code | Content Type | +| ---------------------------- | ---------------------------- | ---------------------------- | +| errors.ErrorMessage | 400, 401, 402, 403, 404, 429 | application/json | +| errors.ErrorMessage | 500, 503 | application/json | | errors.SDKError | 4XX, 5XX | \*/\* | \ No newline at end of file diff --git a/sync-for-expenses/files.gen b/sync-for-expenses/files.gen deleted file mode 100755 index 951bb2a9e..000000000 --- a/sync-for-expenses/files.gen +++ /dev/null @@ -1,377 +0,0 @@ -src/sdk/companies.ts -src/sdk/connections.ts -src/sdk/accounts.ts -src/sdk/customers.ts -src/sdk/suppliers.ts -src/sdk/managedata.ts -src/sdk/pushoperations.ts -src/sdk/configuration.ts -src/sdk/expenses.ts -src/sdk/sync.ts -src/sdk/transactionstatus.ts -src/sdk/sdk.ts -.eslintrc.yml -jest.config.js -package-lock.json -package.json -src/index.ts -src/internal/utils/contenttype.ts -src/internal/utils/headers.ts -src/internal/utils/index.ts -src/internal/utils/pathparams.ts -src/internal/utils/queryparams.ts -src/internal/utils/requestbody.ts -src/internal/utils/retries.ts -src/internal/utils/security.ts -src/internal/utils/utils.ts -src/sdk/index.ts -src/sdk/models/errors/sdkerror.ts -src/sdk/types/index.ts -src/sdk/types/rfcdate.ts -tsconfig.json -src/sdk/models/operations/createcompany.ts -src/sdk/models/operations/deletecompany.ts -src/sdk/models/operations/getcompany.ts -src/sdk/models/operations/listcompanies.ts -src/sdk/models/operations/updatecompany.ts -src/sdk/models/operations/createconnection.ts -src/sdk/models/operations/createpartnerexpenseconnection.ts -src/sdk/models/operations/deleteconnection.ts -src/sdk/models/operations/getconnection.ts -src/sdk/models/operations/listconnections.ts -src/sdk/models/operations/unlinkconnection.ts -src/sdk/models/operations/createaccount.ts -src/sdk/models/operations/getcreatechartofaccountsmodel.ts -src/sdk/models/operations/createcustomer.ts -src/sdk/models/operations/getcustomer.ts -src/sdk/models/operations/listcustomers.ts -src/sdk/models/operations/updatecustomer.ts -src/sdk/models/operations/createsupplier.ts -src/sdk/models/operations/getsupplier.ts -src/sdk/models/operations/listsuppliers.ts -src/sdk/models/operations/updatesupplier.ts -src/sdk/models/operations/getdatastatus.ts -src/sdk/models/operations/getpulloperation.ts -src/sdk/models/operations/listpulloperations.ts -src/sdk/models/operations/refreshalldatatypes.ts -src/sdk/models/operations/refreshdatatype.ts -src/sdk/models/operations/getpushoperation.ts -src/sdk/models/operations/listpushoperations.ts -src/sdk/models/operations/getcompanyconfiguration.ts -src/sdk/models/operations/getmappingoptions.ts -src/sdk/models/operations/setcompanyconfiguration.ts -src/sdk/models/operations/createexpensetransaction.ts -src/sdk/models/operations/updateexpensetransaction.ts -src/sdk/models/operations/uploadexpenseattachment.ts -src/sdk/models/operations/getsyncbyid.ts -src/sdk/models/operations/getlastsuccessfulsync.ts -src/sdk/models/operations/getlatestsync.ts -src/sdk/models/operations/initiatesync.ts -src/sdk/models/operations/listsyncs.ts -src/sdk/models/operations/getsynctransaction.ts -src/sdk/models/operations/listsynctransactions.ts -src/sdk/models/shared/errormessage.ts -src/sdk/models/shared/company.ts -src/sdk/models/shared/connection.ts -src/sdk/models/shared/dataconnectionstatus.ts -src/sdk/models/shared/dataconnectionerror.ts -src/sdk/models/shared/companyrequestbody.ts -src/sdk/models/shared/companies.ts -src/sdk/models/shared/links.ts -src/sdk/models/shared/halref.ts -src/sdk/models/shared/connections.ts -src/sdk/models/shared/createaccountresponse.ts -src/sdk/models/shared/validation.ts -src/sdk/models/shared/validationitem.ts -src/sdk/models/shared/pushoperationstatus.ts -src/sdk/models/shared/datatype.ts -src/sdk/models/shared/account.ts -src/sdk/models/shared/accounttype.ts -src/sdk/models/shared/supplementaldata.ts -src/sdk/models/shared/accountstatus.ts -src/sdk/models/shared/pushoperationchange.ts -src/sdk/models/shared/pushchangetype.ts -src/sdk/models/shared/pushoperationref.ts -src/sdk/models/shared/accountprototype.ts -src/sdk/models/shared/pushoption.ts -src/sdk/models/shared/pushvalidationinfo.ts -src/sdk/models/shared/pushfieldvalidation.ts -src/sdk/models/shared/pushoptiontype.ts -src/sdk/models/shared/pushoptionproperty.ts -src/sdk/models/shared/pushoptionchoice.ts -src/sdk/models/shared/createcustomerresponse.ts -src/sdk/models/shared/customer.ts -src/sdk/models/shared/customerstatus.ts -src/sdk/models/shared/metadata.ts -src/sdk/models/shared/contact.ts -src/sdk/models/shared/phonenumbertype.ts -src/sdk/models/shared/items.ts -src/sdk/models/shared/accountingaddresstype.ts -src/sdk/models/shared/customers.ts -src/sdk/models/shared/updatecustomerresponse.ts -src/sdk/models/shared/createsupplierresponse.ts -src/sdk/models/shared/supplier.ts -src/sdk/models/shared/supplierstatus.ts -src/sdk/models/shared/suppliers.ts -src/sdk/models/shared/updatesupplierresponse.ts -src/sdk/models/shared/datastatus.ts -src/sdk/models/shared/pulloperation.ts -src/sdk/models/shared/pulloperations.ts -src/sdk/models/shared/schemadatatype.ts -src/sdk/models/shared/pushoperation.ts -src/sdk/models/shared/pushoperations.ts -src/sdk/models/shared/companyconfiguration.ts -src/sdk/models/shared/supplierdetails.ts -src/sdk/models/shared/customerdetails.ts -src/sdk/models/shared/bankaccount.ts -src/sdk/models/shared/mappingoptions.ts -src/sdk/models/shared/trackingcategorymappinginfo.ts -src/sdk/models/shared/taxratemappinginfo.ts -src/sdk/models/shared/accountmappinginfo.ts -src/sdk/models/shared/createexpenseresponse.ts -src/sdk/models/shared/createexpenserequest.ts -src/sdk/models/shared/expensetransaction.ts -src/sdk/models/shared/expensetransactionline.ts -src/sdk/models/shared/trackingref.ts -src/sdk/models/shared/recordref.ts -src/sdk/models/shared/invoiceto.ts -src/sdk/models/shared/contactref.ts -src/sdk/models/shared/updateexpenseresponse.ts -src/sdk/models/shared/updateexpenserequest.ts -src/sdk/models/shared/attachment.ts -src/sdk/models/shared/attachmentupload.ts -src/sdk/models/shared/codatfile.ts -src/sdk/models/shared/companysyncstatus.ts -src/sdk/models/shared/syncinitiated.ts -src/sdk/models/shared/initiatesync.ts -src/sdk/models/shared/transaction.ts -src/sdk/models/shared/transactionstatus.ts -src/sdk/models/shared/integrationtype.ts -src/sdk/models/shared/transactions.ts -src/sdk/models/shared/security.ts -src/sdk/models/shared/clientratelimitreachedwebhook.ts -src/sdk/models/shared/clientratelimitreachedwebhookdata.ts -src/sdk/models/shared/clientratelimitresetwebhook.ts -src/sdk/models/shared/clientratelimitresetwebhookdata.ts -src/sdk/models/shared/synccompletewebhook.ts -src/sdk/models/shared/synccompletewebhookdata.ts -src/sdk/models/shared/syncfailedwebhook.ts -src/sdk/models/shared/syncfailedwebhookdata.ts -src/sdk/models/shared/syncstartedwebhook.ts -src/sdk/models/webhooks/clientratelimitreached.ts -src/sdk/models/webhooks/clientratelimitreset.ts -src/sdk/models/webhooks/synccomplete.ts -src/sdk/models/webhooks/syncfailed.ts -src/sdk/models/webhooks/syncstarted.ts -src/sdk/models/errors/index.ts -src/sdk/models/operations/index.ts -src/sdk/models/shared/index.ts -src/sdk/models/webhooks/index.ts -docs/sdk/models/operations/createcompanyresponse.md -docs/sdk/models/operations/deletecompanyrequest.md -docs/sdk/models/operations/deletecompanyresponse.md -docs/sdk/models/operations/getcompanyrequest.md -docs/sdk/models/operations/getcompanyresponse.md -docs/sdk/models/operations/listcompaniesrequest.md -docs/sdk/models/operations/listcompaniesresponse.md -docs/sdk/models/operations/updatecompanyrequest.md -docs/sdk/models/operations/updatecompanyresponse.md -docs/sdk/models/operations/createconnectionrequestbody.md -docs/sdk/models/operations/createconnectionrequest.md -docs/sdk/models/operations/createconnectionresponse.md -docs/sdk/models/operations/createpartnerexpenseconnectionrequest.md -docs/sdk/models/operations/createpartnerexpenseconnectionresponse.md -docs/sdk/models/operations/deleteconnectionrequest.md -docs/sdk/models/operations/deleteconnectionresponse.md -docs/sdk/models/operations/getconnectionrequest.md -docs/sdk/models/operations/getconnectionresponse.md -docs/sdk/models/operations/listconnectionsrequest.md -docs/sdk/models/operations/listconnectionsresponse.md -docs/sdk/models/operations/unlinkconnectionupdateconnection.md -docs/sdk/models/operations/unlinkconnectionrequest.md -docs/sdk/models/operations/unlinkconnectionresponse.md -docs/sdk/models/operations/createaccountrequest.md -docs/sdk/models/operations/createaccountresponse.md -docs/sdk/models/operations/getcreatechartofaccountsmodelrequest.md -docs/sdk/models/operations/getcreatechartofaccountsmodelresponse.md -docs/sdk/models/operations/createcustomerrequest.md -docs/sdk/models/operations/createcustomerresponse.md -docs/sdk/models/operations/getcustomerrequest.md -docs/sdk/models/operations/getcustomerresponse.md -docs/sdk/models/operations/listcustomersrequest.md -docs/sdk/models/operations/listcustomersresponse.md -docs/sdk/models/operations/updatecustomerrequest.md -docs/sdk/models/operations/updatecustomerresponse.md -docs/sdk/models/operations/createsupplierrequest.md -docs/sdk/models/operations/createsupplierresponse.md -docs/sdk/models/operations/getsupplierrequest.md -docs/sdk/models/operations/getsupplierresponse.md -docs/sdk/models/operations/listsuppliersrequest.md -docs/sdk/models/operations/listsuppliersresponse.md -docs/sdk/models/operations/updatesupplierrequest.md -docs/sdk/models/operations/updatesupplierresponse.md -docs/sdk/models/operations/getdatastatusrequest.md -docs/sdk/models/operations/getdatastatusresponse.md -docs/sdk/models/operations/getpulloperationrequest.md -docs/sdk/models/operations/getpulloperationresponse.md -docs/sdk/models/operations/listpulloperationsrequest.md -docs/sdk/models/operations/listpulloperationsresponse.md -docs/sdk/models/operations/refreshalldatatypesrequest.md -docs/sdk/models/operations/refreshalldatatypesresponse.md -docs/sdk/models/operations/refreshdatatyperequest.md -docs/sdk/models/operations/refreshdatatyperesponse.md -docs/sdk/models/operations/getpushoperationrequest.md -docs/sdk/models/operations/getpushoperationresponse.md -docs/sdk/models/operations/listpushoperationsrequest.md -docs/sdk/models/operations/listpushoperationsresponse.md -docs/sdk/models/operations/getcompanyconfigurationrequest.md -docs/sdk/models/operations/getcompanyconfigurationresponse.md -docs/sdk/models/operations/getmappingoptionsrequest.md -docs/sdk/models/operations/getmappingoptionsresponse.md -docs/sdk/models/operations/setcompanyconfigurationrequest.md -docs/sdk/models/operations/setcompanyconfigurationresponse.md -docs/sdk/models/operations/createexpensetransactionrequest.md -docs/sdk/models/operations/createexpensetransactionresponse.md -docs/sdk/models/operations/updateexpensetransactionrequest.md -docs/sdk/models/operations/updateexpensetransactionresponse.md -docs/sdk/models/operations/uploadexpenseattachmentrequest.md -docs/sdk/models/operations/uploadexpenseattachmentresponse.md -docs/sdk/models/operations/getsyncbyidrequest.md -docs/sdk/models/operations/getsyncbyidresponse.md -docs/sdk/models/operations/getlastsuccessfulsyncrequest.md -docs/sdk/models/operations/getlastsuccessfulsyncresponse.md -docs/sdk/models/operations/getlatestsyncrequest.md -docs/sdk/models/operations/getlatestsyncresponse.md -docs/sdk/models/operations/initiatesyncrequest.md -docs/sdk/models/operations/initiatesyncresponse.md -docs/sdk/models/operations/listsyncsrequest.md -docs/sdk/models/operations/listsyncsresponse.md -docs/sdk/models/operations/getsynctransactionrequest.md -docs/sdk/models/operations/getsynctransactionresponse.md -docs/sdk/models/operations/listsynctransactionsrequest.md -docs/sdk/models/operations/listsynctransactionsresponse.md -docs/sdk/models/shared/errormessage.md -docs/sdk/models/shared/company.md -docs/sdk/models/shared/sourcetype.md -docs/sdk/models/shared/connection.md -docs/sdk/models/shared/dataconnectionstatus.md -docs/sdk/models/shared/dataconnectionerror.md -docs/sdk/models/shared/companyrequestbody.md -docs/sdk/models/shared/companies.md -docs/sdk/models/shared/links.md -docs/sdk/models/shared/halref.md -docs/sdk/models/shared/connections.md -docs/sdk/models/shared/createaccountresponse.md -docs/sdk/models/shared/validation.md -docs/sdk/models/shared/validationitem.md -docs/sdk/models/shared/pushoperationstatus.md -docs/sdk/models/shared/datatype.md -docs/sdk/models/shared/accountmetadata.md -docs/sdk/models/shared/accountvaliddatatypelinks.md -docs/sdk/models/shared/account.md -docs/sdk/models/shared/accounttype.md -docs/sdk/models/shared/supplementaldata.md -docs/sdk/models/shared/accountstatus.md -docs/sdk/models/shared/pushoperationchange.md -docs/sdk/models/shared/pushchangetype.md -docs/sdk/models/shared/pushoperationref.md -docs/sdk/models/shared/validdatatypelinks.md -docs/sdk/models/shared/accountprototype.md -docs/sdk/models/shared/pushoption.md -docs/sdk/models/shared/pushvalidationinfo.md -docs/sdk/models/shared/pushfieldvalidation.md -docs/sdk/models/shared/pushoptiontype.md -docs/sdk/models/shared/pushoptionproperty.md -docs/sdk/models/shared/pushoptionchoice.md -docs/sdk/models/shared/createcustomerresponse.md -docs/sdk/models/shared/accountingaddress.md -docs/sdk/models/shared/customer.md -docs/sdk/models/shared/customerstatus.md -docs/sdk/models/shared/metadata.md -docs/sdk/models/shared/phone.md -docs/sdk/models/shared/contact.md -docs/sdk/models/shared/phonenumbertype.md -docs/sdk/models/shared/items.md -docs/sdk/models/shared/accountingaddresstype.md -docs/sdk/models/shared/customers.md -docs/sdk/models/shared/updatecustomerresponse.md -docs/sdk/models/shared/createsupplierresponse.md -docs/sdk/models/shared/supplier.md -docs/sdk/models/shared/supplierstatus.md -docs/sdk/models/shared/suppliers.md -docs/sdk/models/shared/updatesupplierresponse.md -docs/sdk/models/shared/datatypes.md -docs/sdk/models/shared/datastatus.md -docs/sdk/models/shared/status.md -docs/sdk/models/shared/pulloperation.md -docs/sdk/models/shared/pulloperations.md -docs/sdk/models/shared/schemadatatype.md -docs/sdk/models/shared/pushoperation.md -docs/sdk/models/shared/pushoperations.md -docs/sdk/models/shared/companyconfiguration.md -docs/sdk/models/shared/supplierdetails.md -docs/sdk/models/shared/customerdetails.md -docs/sdk/models/shared/bankaccount.md -docs/sdk/models/shared/mappingoptions.md -docs/sdk/models/shared/trackingcategorymappinginfo.md -docs/sdk/models/shared/taxratemappinginfovalidtransactiontypes.md -docs/sdk/models/shared/taxratemappinginfo.md -docs/sdk/models/shared/accountmappinginfoaccounttype.md -docs/sdk/models/shared/validtransactiontypes.md -docs/sdk/models/shared/accountmappinginfo.md -docs/sdk/models/shared/createexpenseresponse.md -docs/sdk/models/shared/createexpenserequest.md -docs/sdk/models/shared/bankaccountreference.md -docs/sdk/models/shared/expensetransactiontype.md -docs/sdk/models/shared/expensetransaction.md -docs/sdk/models/shared/expensetransactionline.md -docs/sdk/models/shared/trackingrefdatatype.md -docs/sdk/models/shared/trackingref.md -docs/sdk/models/shared/recordref.md -docs/sdk/models/shared/invoiceto.md -docs/sdk/models/shared/typet.md -docs/sdk/models/shared/contactref.md -docs/sdk/models/shared/updateexpenseresponse.md -docs/sdk/models/shared/updateexpenserequestbankaccountreference.md -docs/sdk/models/shared/updateexpenserequest.md -docs/sdk/models/shared/attachment.md -docs/sdk/models/shared/attachmentupload.md -docs/sdk/models/shared/codatfile.md -docs/sdk/models/shared/companysyncstatus.md -docs/sdk/models/shared/syncinitiated.md -docs/sdk/models/shared/initiatesync.md -docs/sdk/models/shared/transaction.md -docs/sdk/models/shared/transactionstatus.md -docs/sdk/models/shared/integrationtype.md -docs/sdk/models/shared/transactions.md -docs/sdk/models/shared/security.md -docs/sdk/models/shared/clientratelimitreachedwebhook.md -docs/sdk/models/shared/clientratelimitreachedwebhookdata.md -docs/sdk/models/shared/clientratelimitresetwebhook.md -docs/sdk/models/shared/clientratelimitresetwebhookdata.md -docs/sdk/models/shared/synccompletewebhook.md -docs/sdk/models/shared/synccompletewebhookdata.md -docs/sdk/models/shared/syncfailedwebhook.md -docs/sdk/models/shared/syncfailedwebhookdata.md -docs/sdk/models/shared/data.md -docs/sdk/models/shared/syncstartedwebhook.md -docs/sdk/models/webhooks/clientratelimitreachedresponse.md -docs/sdk/models/webhooks/clientratelimitresetresponse.md -docs/sdk/models/webhooks/synccompleteresponse.md -docs/sdk/models/webhooks/syncfailedresponse.md -docs/sdk/models/webhooks/syncstartedresponse.md -docs/sdks/codatsyncexpenses/README.md -docs/internal/utils/retryconfig.md -docs/sdks/companies/README.md -docs/sdks/connections/README.md -docs/sdks/accounts/README.md -docs/sdks/customers/README.md -docs/sdks/suppliers/README.md -docs/sdks/managedata/README.md -docs/sdks/pushoperations/README.md -docs/sdks/configuration/README.md -docs/sdks/expenses/README.md -docs/sdks/sync/README.md -docs/sdks/transactionstatus/README.md -USAGE.md -.gitattributes \ No newline at end of file diff --git a/sync-for-expenses/jsr.json b/sync-for-expenses/jsr.json deleted file mode 100644 index f835e8b1c..000000000 --- a/sync-for-expenses/jsr.json +++ /dev/null @@ -1,27 +0,0 @@ - - -{ - "name": "@codat/sync-for-expenses", - "version": "7.1.1", - "exports": { - ".": "./src/index.ts", - "./sdk/models/errors": "./src/sdk/models/errors/index.ts", - "./sdk/models/shared": "./src/sdk/models/shared/index.ts", - "./sdk/models/operations": "./src/sdk/models/operations/index.ts", - "./lib/config": "./src/lib/config.ts", - "./lib/http": "./src/lib/http.ts", - "./lib/retries": "./src/lib/retries.ts", - "./lib/sdks": "./src/lib/sdks.ts", - "./types": "./src/sdk/types/index.ts" - }, - "publish": { - "include": [ - "LICENSE", - "README.md", - "RUNTIMES.md", - "USAGE.md", - "jsr.json", - "src/**/*.ts" - ] - } -} diff --git a/sync-for-expenses/package.json b/sync-for-expenses/package.json index 2e9cb4add..3ad15a4fe 100644 --- a/sync-for-expenses/package.json +++ b/sync-for-expenses/package.json @@ -1,31 +1,59 @@ { "name": "@codat/sync-for-expenses", - "version": "7.1.1", + "version": "7.1.2", "author": "Codat", - "main": "./index.js", - "sideEffects": false, "repository": { "type": "git", "url": "https://github.com/codatio/client-sdk-typescript.git", "directory": "sync-for-expenses" }, + "main": "./dist/index.js", + "typings": "./dist/index.d.ts", + "module": "./dist/esm/index.js", + "sideEffects": false, "scripts": { - "lint": "eslint --cache --max-warnings=0 src", - "build": "tsc", - "prepublishOnly": "npm run build" - }, - "peerDependencies": { - + "build": "tsc && tsc -p tsconfig.esm.json", + "prepare": "npm run build" }, "devDependencies": { - "@eslint/js": "^9.26.0", - "eslint": "^9.26.0", - "globals": "^15.14.0", - "typescript": "~5.8.3", - "typescript-eslint": "^8.26.0" + "typescript": "^4.0 || ^5.0" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "./sdk/models/shared": { + "types": "./dist/sdk/models/shared/index.d.ts", + "default": "./dist/sdk/models/shared/index.js" + }, + "./sdk/models/operations": { + "types": "./dist/sdk/models/operations/index.d.ts", + "default": "./dist/sdk/models/operations/index.js" + }, + "./sdk/models/errors": { + "types": "./dist/sdk/models/errors/index.d.ts", + "default": "./dist/sdk/models/errors/index.js" + }, + "./sdk/types": { + "types": "./dist/sdk/types/index.d.ts", + "default": "./dist/sdk/types/index.js" + }, + "./core.js": { + "types": "./dist/core.d.ts", + "default": "./dist/core.js" + }, + "./lib/http": { + "types": "./dist/lib/sdkconfig.d.ts", + "default": "./dist/lib/sdkconfig.js" + }, + "./funcs/*.js": { + "types": "./dist/funcs/*.d.ts", + "default": "./dist/funcs/*.js" + }, + "./package.json": "./package.json" }, "dependencies": { - "decimal.js": "^10.4.3", - "zod": "^3.25.0 || ^4.0.0" + "decimal.js": "^10.4.3" } } diff --git a/sync-for-expenses/src/apis/Accounts.ts b/sync-for-expenses/src/apis/Accounts.ts new file mode 100644 index 000000000..7d3412709 --- /dev/null +++ b/sync-for-expenses/src/apis/Accounts.ts @@ -0,0 +1,162 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AccountPrototype, + CreateAccountResponse, + ErrorMessage, + PushOption, +} from '../sdk/models/index'; +import { + AccountPrototypeFromJSON, + AccountPrototypeToJSON, + CreateAccountResponseFromJSON, + CreateAccountResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PushOptionFromJSON, + PushOptionToJSON, +} from '../sdk/models/index'; + +export interface CreateAccountRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + accountPrototype?: AccountPrototype; +} + +export interface GetCreateChartOfAccountsModelRequest { + companyId: string; + connectionId: string; +} + +/** + * + */ +export class Accounts extends runtime.BaseAPI { + + /** + * The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company\'s connection. [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + * Create account + */ + private async createAccountRaw(requestParameters: CreateAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createAccount().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/accounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-account', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: AccountPrototypeToJSON(requestParameters['accountPrototype']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateAccountResponseFromJSON(jsonValue)); + } + + /** + * The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company\'s connection. [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + * Create account + */ + async create(requestParameters: CreateAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createAccountRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create account model + */ + private async getCreateChartOfAccountsModelRaw(requestParameters: GetCreateChartOfAccountsModelRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCreateChartOfAccountsModel().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCreateChartOfAccountsModel().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-create-chartOfAccounts-model', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOptionFromJSON(jsonValue)); + } + + /** + * The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create account model + */ + async getCreateModel(requestParameters: GetCreateChartOfAccountsModelRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCreateChartOfAccountsModelRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Adjustments.ts b/sync-for-expenses/src/apis/Adjustments.ts new file mode 100644 index 000000000..edeb813b7 --- /dev/null +++ b/sync-for-expenses/src/apis/Adjustments.ts @@ -0,0 +1,85 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + AdjustmentTransactionRequest, + AdjustmentTransactionResponse, + ErrorMessage, +} from '../sdk/models/index'; +import { + AdjustmentTransactionRequestFromJSON, + AdjustmentTransactionRequestToJSON, + AdjustmentTransactionResponseFromJSON, + AdjustmentTransactionResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateAdjustmentTransactionRequest { + companyId: string; + requestBody?: Array; +} + +/** + * + */ +export class Adjustments extends runtime.BaseAPI { + + /** + * Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company\'s connection. Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | QuickBooks Desktop | Yes | + * Create adjustment transaction + */ + private async createAdjustmentTransactionRaw(requestParameters: CreateAdjustmentTransactionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createAdjustmentTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/adjustment-transactions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-adjustment-transaction', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody']!.map(AdjustmentTransactionRequestToJSON), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => AdjustmentTransactionResponseFromJSON(jsonValue)); + } + + /** + * Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company\'s connection. Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | QuickBooks Desktop | Yes | + * Create adjustment transaction + */ + async create(requestParameters: CreateAdjustmentTransactionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createAdjustmentTransactionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Attachments.ts b/sync-for-expenses/src/apis/Attachments.ts new file mode 100644 index 000000000..07fc9b848 --- /dev/null +++ b/sync-for-expenses/src/apis/Attachments.ts @@ -0,0 +1,144 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { CodatFile } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type { + Attachment, + ErrorMessage, +} from '../sdk/models/index'; +import { + AttachmentFromJSON, + AttachmentToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface UploadExpenseAttachmentRequest { + companyId: string; + syncId: string; + transactionId: string; + file?: CodatFile | Blob; +} + +/** + * + */ +export class Attachments extends runtime.BaseAPI { + + /** + * The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. **Integration-specific behavior** Each accounting software supports different file formats and sizes. | Integration | File size | File extension | Supported transactions | |-----------------------------------|-----------|-------------------------------------------------------|------------------------| | **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | | **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `expense-transactions.Payment`, `expense-transactions.Refund`, `reimbursable-expense-transactions` | | **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`expense-transactions.Payment`, `expense-transactions.Refund` | | **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types | **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | | **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | **Zoho Books** | 5MB | GIF, PNG, JPEG, JPG, BMP, PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | + * Upload attachment + */ + private async uploadExpenseAttachmentRaw(requestParameters: UploadExpenseAttachmentRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling uploadExpenseAttachment().' + ); + } + + if (requestParameters['syncId'] == null) { + throw new runtime.RequiredError( + 'syncId', + 'Required parameter "syncId" was null or undefined when calling uploadExpenseAttachment().' + ); + } + + if (requestParameters['transactionId'] == null) { + throw new runtime.RequiredError( + 'transactionId', + 'Required parameter "transactionId" was null or undefined when calling uploadExpenseAttachment().' + ); + } + + if (requestParameters['file'] == null) { + throw new runtime.RequiredError( + 'file', + 'Required parameter "file" was null or undefined when calling uploadExpenseAttachment().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const consumes: runtime.Consume[] = [ + { contentType: 'multipart/form-data' }, + ]; + // @ts-ignore: canConsumeForm may be unused + const canConsumeForm = runtime.canConsumeForm(consumes); + + let formParams: { append(param: string, value: any, fileName?: string): any }; + let useForm = false; + // use FormData to transmit files using content-type "multipart/form-data" + useForm = canConsumeForm; + if (useForm) { + formParams = new FormData(); + } else { + formParams = new URLSearchParams(); + } + + if (requestParameters['file'] != null) { + const uploadFile: any = requestParameters['file']; + if (uploadFile && typeof uploadFile === 'object' && 'content' in uploadFile) { + const uploadBlob = new Blob([uploadFile.content], { type: getContentTypeFromFileName(uploadFile.fileName) }); + formParams.append('file', uploadBlob, uploadFile.fileName); + } else { + formParams.append('file', uploadFile as any); + } + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"syncId"}}`, encodeURIComponent(String(requestParameters['syncId']))).replace(`{${"transactionId"}}`, encodeURIComponent(String(requestParameters['transactionId']))), + method: 'POST', + operationId: 'upload-expense-attachment', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: formParams, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => AttachmentFromJSON(jsonValue)); + } + + /** + * The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. **Integration-specific behavior** Each accounting software supports different file formats and sizes. | Integration | File size | File extension | Supported transactions | |-----------------------------------|-----------|-------------------------------------------------------|------------------------| | **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | | **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `expense-transactions.Payment`, `expense-transactions.Refund`, `reimbursable-expense-transactions` | | **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`expense-transactions.Payment`, `expense-transactions.Refund` | | **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types | **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | | **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | **Zoho Books** | 5MB | GIF, PNG, JPEG, JPG, BMP, PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | + * Upload attachment + */ + async upload(requestParameters: UploadExpenseAttachmentRequest, options?: runtime.RequestOptions): Promise { + const response = await this.uploadExpenseAttachmentRaw(requestParameters, options); + return await response.value(); + } + +} + +function getContentTypeFromFileName(fileName: string): string { + const ext = (fileName || '').toLowerCase().split('.').pop(); + const mimeTypes: Record = { + json: 'application/json', xml: 'application/xml', html: 'text/html', htm: 'text/html', + txt: 'text/plain', csv: 'text/csv', pdf: 'application/pdf', png: 'image/png', + jpg: 'image/jpeg', jpeg: 'image/jpeg', gif: 'image/gif', svg: 'image/svg+xml', + js: 'application/javascript', css: 'text/css', zip: 'application/zip', tar: 'application/x-tar', + gz: 'application/gzip', mp4: 'video/mp4', mp3: 'audio/mpeg', wav: 'audio/wav', + webp: 'image/webp', ico: 'image/x-icon', woff: 'font/woff', woff2: 'font/woff2', + ttf: 'font/ttf', otf: 'font/otf', + }; + return (ext && mimeTypes[ext]) || 'application/octet-stream'; +} diff --git a/sync-for-expenses/src/apis/BankAccounts.ts b/sync-for-expenses/src/apis/BankAccounts.ts new file mode 100644 index 000000000..166318302 --- /dev/null +++ b/sync-for-expenses/src/apis/BankAccounts.ts @@ -0,0 +1,162 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + BankAccount, + CreateBankAccountResponse, + ErrorMessage, + PushOption, +} from '../sdk/models/index'; +import { + BankAccountFromJSON, + BankAccountToJSON, + CreateBankAccountResponseFromJSON, + CreateBankAccountResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PushOptionFromJSON, + PushOptionToJSON, +} from '../sdk/models/index'; + +export interface CreateBankAccountRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + bankAccount?: BankAccount; +} + +export interface GetCreateBankAccountsModelRequest { + companyId: string; + connectionId: string; +} + +/** + * + */ +export class BankAccounts extends runtime.BaseAPI { + + /** + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). + * Create bank account + */ + private async createBankAccountRaw(requestParameters: CreateBankAccountRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createBankAccount().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createBankAccount().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/bankAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-bank-account', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: BankAccountToJSON(requestParameters['bankAccount']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateBankAccountResponseFromJSON(jsonValue)); + } + + /** + * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company\'s connection. [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). + * Create bank account + */ + async create(requestParameters: CreateBankAccountRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createBankAccountRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create bank account model + */ + private async getCreateBankAccountsModelRaw(requestParameters: GetCreateBankAccountsModelRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCreateBankAccountsModel().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getCreateBankAccountsModel().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/options/bankAccounts`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-create-bankAccounts-model', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOptionFromJSON(jsonValue)); + } + + /** + * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. **Integration-specific behavior** See the *response examples* for integration-specific indicative models. + * Get create bank account model + */ + async getCreateModel(requestParameters: GetCreateBankAccountsModelRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCreateBankAccountsModelRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Companies.ts b/sync-for-expenses/src/apis/Companies.ts new file mode 100644 index 000000000..ac126a5c7 --- /dev/null +++ b/sync-for-expenses/src/apis/Companies.ts @@ -0,0 +1,338 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Company, + CompanyRequestBody, + CompanyUpdateRequest, + ErrorMessage, +} from '../sdk/models/index'; +import { + CompaniesFromJSON, + CompaniesToJSON, + CompanyFromJSON, + CompanyToJSON, + CompanyRequestBodyFromJSON, + CompanyRequestBodyToJSON, + CompanyUpdateRequestFromJSON, + CompanyUpdateRequestToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody; +} + +export interface DeleteCompanyRequest { + companyId: string; +} + +export interface GetCompanyRequest { + companyId: string; +} + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; +} + +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody; +} + +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest; +} + +/** + * + */ +export class Companies extends runtime.BaseAPI { + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * Create company + */ + private async createCompanyRaw(requestParameters: CreateCompanyRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'POST', + operationId: 'create-company', + errorStatuses: [400, 401, 402, 403, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. + * Create company + */ + async create(companyRequestBody?: CompanyRequestBody, options?: runtime.RequestOptions): Promise { + const response = await this.createCompanyRaw({ companyRequestBody: companyRequestBody }, options); + return await response.value(); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + * Delete a company + */ + private async deleteCompanyRaw(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'DELETE', + operationId: 'delete-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + * Delete a company + */ + async delete(requestParameters: DeleteCompanyRequest, options?: runtime.RequestOptions): Promise { + await this.deleteCompanyRaw(requestParameters, options); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + * Get company + */ + private async getCompanyRaw(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * The *Get company* endpoint returns a single company for a given `companyId`. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + * Get company + */ + async get(requestParameters: GetCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + private async listCompaniesRaw(requestParameters: ListCompaniesRequest, options?: runtime.RequestOptions): Promise> { + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + if (requestParameters['tags'] != null) { + queryParameters['tags'] = requestParameters['tags']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies`, + method: 'GET', + operationId: 'list-companies', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompaniesFromJSON(jsonValue)); + } + + /** + * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. ## Filter by tags The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - equals (`=`) - not equals (`!=`) - contains (`~`) For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - Foreign key: `uid = {yourCustomerId}` - Region: `region != uk` - Owning team and region: `region = uk && owningTeam = invoice-finance` + * List companies + */ + async list(requestParameters: ListCompaniesRequest = {}, options?: runtime.RequestOptions): Promise { + const response = await this.listCompaniesRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + * Replace company + */ + private async replaceCompanyRaw(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling replaceCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PUT', + operationId: 'replace-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyRequestBodyToJSON(requestParameters['companyRequestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven\'t been defined in the payload. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. + * Replace company + */ + async replace(requestParameters: ReplaceCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.replaceCompanyRaw(requestParameters, options); + return await response.value(); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + private async updateCompanyRaw(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateCompany().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'PATCH', + operationId: 'update-company', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyUpdateRequestToJSON(requestParameters['companyUpdateRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyFromJSON(jsonValue)); + } + + /** + * Use the *Update company* endpoint to update the name, description, or tags of the company. The *Update company* endpoint doesn\'t have any required fields. If any of the fields provided are `null` or not provided, they won\'t be included in the update. A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. + * Update company + */ + async update(requestParameters: UpdateCompanyRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateCompanyRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/CompanyInfo.ts b/sync-for-expenses/src/apis/CompanyInfo.ts new file mode 100644 index 000000000..74bba8664 --- /dev/null +++ b/sync-for-expenses/src/apis/CompanyInfo.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CompanyInformation, + ErrorMessage, +} from '../sdk/models/index'; +import { + CompanyInformationFromJSON, + CompanyInformationToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface GetCompanyInfoRequest { + companyId: string; +} + +/** + * + */ +export class CompanyInfo extends runtime.BaseAPI { + + /** + * Gets the latest basic info for a company. + * Get company info + */ + private async getCompanyInfoRaw(requestParameters: GetCompanyInfoRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyInfo().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/info`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-info', + errorStatuses: [401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyInformationFromJSON(jsonValue)); + } + + /** + * Gets the latest basic info for a company. + * Get company info + */ + async get(requestParameters: GetCompanyInfoRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyInfoRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Configuration.ts b/sync-for-expenses/src/apis/Configuration.ts new file mode 100644 index 000000000..968cad8ae --- /dev/null +++ b/sync-for-expenses/src/apis/Configuration.ts @@ -0,0 +1,127 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CompanyConfiguration, + ErrorMessage, +} from '../sdk/models/index'; +import { + CompanyConfigurationFromJSON, + CompanyConfigurationToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface GetCompanyConfigurationRequest { + companyId: string; +} + +export interface SetCompanyConfigurationRequest { + companyId: string; + companyConfiguration?: CompanyConfiguration; +} + +/** + * + */ +export class Configuration extends runtime.BaseAPI { + + /** + * Gets a company\'s expense sync configuration + * Get company configuration + */ + private async getCompanyConfigurationRaw(requestParameters: GetCompanyConfigurationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCompanyConfiguration().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/config`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-company-configuration', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyConfigurationFromJSON(jsonValue)); + } + + /** + * Gets a company\'s expense sync configuration + * Get company configuration + */ + async get(requestParameters: GetCompanyConfigurationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCompanyConfigurationRaw(requestParameters, options); + return await response.value(); + } + + /** + * Sets a company\'s expense sync configuration + * Set company configuration + */ + private async setCompanyConfigurationRaw(requestParameters: SetCompanyConfigurationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling setCompanyConfiguration().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/config`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'set-company-configuration', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CompanyConfigurationToJSON(requestParameters['companyConfiguration']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanyConfigurationFromJSON(jsonValue)); + } + + /** + * Sets a company\'s expense sync configuration + * Set company configuration + */ + async set(requestParameters: SetCompanyConfigurationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.setCompanyConfigurationRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Connections.ts b/sync-for-expenses/src/apis/Connections.ts new file mode 100644 index 000000000..f42b9da09 --- /dev/null +++ b/sync-for-expenses/src/apis/Connections.ts @@ -0,0 +1,369 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + Connection, + CreateConnectionRequestBody, + ErrorMessage, + UpdateConnection, +} from '../sdk/models/index'; +import { + ConnectionFromJSON, + ConnectionToJSON, + ConnectionsFromJSON, + ConnectionsToJSON, + CreateConnectionRequestBodyFromJSON, + CreateConnectionRequestBodyToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + UpdateConnectionFromJSON, + UpdateConnectionToJSON, +} from '../sdk/models/index'; + +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody; +} + +export interface CreatePartnerExpenseConnectionRequest { + companyId: string; +} + +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface GetConnectionRequest { + companyId: string; + connectionId: string; +} + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + requestBody?: UpdateConnection; +} + +/** + * + */ +export class Connections extends runtime.BaseAPI { + + /** + * Creates a connection for the company by providing a valid `platformKey`. Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + * Create connection + */ + private async createConnectionRaw(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CreateConnectionRequestBodyToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Creates a connection for the company by providing a valid `platformKey`. Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. + * Create connection + */ + async create(requestParameters: CreateConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * Creates a partner expense data connection + * Create partner expense connection + */ + private async createPartnerExpenseConnectionRaw(requestParameters: CreatePartnerExpenseConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createPartnerExpenseConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/connections/partnerExpense`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-partner-expense-connection', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * Creates a partner expense data connection + * Create partner expense connection + */ + async createPartnerExpenseConnection(requestParameters: CreatePartnerExpenseConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createPartnerExpenseConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * 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. + * Delete connection + */ + private async deleteConnectionRaw(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling deleteConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling deleteConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'DELETE', + operationId: 'delete-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * 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. + * Delete connection + */ + async delete(requestParameters: DeleteConnectionRequest, options?: runtime.RequestOptions): Promise { + await this.deleteConnectionRaw(requestParameters, options); + } + + /** + * 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. + * Get connection + */ + private async getConnectionRaw(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling getConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'GET', + operationId: 'get-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * 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. + * Get connection + */ + async get(requestParameters: GetConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getConnectionRaw(requestParameters, options); + return await response.value(); + } + + /** + * List the connections for a company. + * List connections + */ + private async listConnectionsRaw(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listConnections().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-connections', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionsFromJSON(jsonValue)); + } + + /** + * List the connections for a company. + * List connections + */ + async list(requestParameters: ListConnectionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listConnectionsRaw(requestParameters, options); + return await response.value(); + } + + /** + * 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. + * Unlink connection + */ + private async unlinkConnectionRaw(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling unlinkConnection().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling unlinkConnection().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'PATCH', + operationId: 'unlink-connection', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateConnectionToJSON(requestParameters['requestBody']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => ConnectionFromJSON(jsonValue)); + } + + /** + * 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. + * Unlink connection + */ + async unlink(requestParameters: UnlinkConnectionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.unlinkConnectionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Customers.ts b/sync-for-expenses/src/apis/Customers.ts new file mode 100644 index 000000000..1c4020240 --- /dev/null +++ b/sync-for-expenses/src/apis/Customers.ts @@ -0,0 +1,322 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + CreateCustomerResponse, + Customer, + ErrorMessage, + UpdateCustomerResponse, +} from '../sdk/models/index'; +import { + CreateCustomerResponseFromJSON, + CreateCustomerResponseToJSON, + CustomerFromJSON, + CustomerToJSON, + CustomersFromJSON, + CustomersToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + UpdateCustomerResponseFromJSON, + UpdateCustomerResponseToJSON, +} from '../sdk/models/index'; + +export interface CreateCustomerRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + customer?: Customer; +} + +export interface GetCustomerRequest { + companyId: string; + customerId: string; +} + +export interface ListCustomersRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface UpdateCustomerRequest { + companyId: string; + connectionId: string; + customerId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + forceUpdate?: boolean; + customer?: Customer; +} + +/** + * + */ +export class Customers extends runtime.BaseAPI { + + /** + * The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company\'s connection. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + * Create customer + */ + private async createCustomerRaw(requestParameters: CreateCustomerRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createCustomer().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createCustomer().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/customers`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-customer', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CustomerToJSON(requestParameters['customer']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateCustomerResponseFromJSON(jsonValue)); + } + + /** + * The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company\'s connection. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + * Create customer + */ + async create(requestParameters: CreateCustomerRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createCustomerRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get customer* endpoint returns a single customer for a given customerId. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). + * Get customer + */ + private async getCustomerRaw(requestParameters: GetCustomerRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getCustomer().' + ); + } + + if (requestParameters['customerId'] == null) { + throw new runtime.RequiredError( + 'customerId', + 'Required parameter "customerId" was null or undefined when calling getCustomer().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/customers/{customerId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))), + method: 'GET', + operationId: 'get-customer', + errorStatuses: [401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CustomerFromJSON(jsonValue)); + } + + /** + * The *Get customer* endpoint returns a single customer for a given customerId. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). + * Get customer + */ + async get(requestParameters: GetCustomerRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getCustomerRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company\'s connection. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). + * List customers + */ + private async listCustomersRaw(requestParameters: ListCustomersRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listCustomers().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/customers`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-customers', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CustomersFromJSON(jsonValue)); + } + + /** + * The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company\'s connection. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). + * List customers + */ + async list(requestParameters: ListCustomersRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listCustomersRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company\'s connection. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + * Update customer + */ + private async updateCustomerRaw(requestParameters: UpdateCustomerRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateCustomer().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling updateCustomer().' + ); + } + + if (requestParameters['customerId'] == null) { + throw new runtime.RequiredError( + 'customerId', + 'Required parameter "customerId" was null or undefined when calling updateCustomer().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + if (requestParameters['forceUpdate'] != null) { + queryParameters['forceUpdate'] = requestParameters['forceUpdate']; + } + else { + queryParameters['forceUpdate'] = false; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/customers/{customerId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"customerId"}}`, encodeURIComponent(String(requestParameters['customerId']))), + method: 'PUT', + operationId: 'update-customer', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: CustomerToJSON(requestParameters['customer']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateCustomerResponseFromJSON(jsonValue)); + } + + /** + * The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company\'s connection. [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). + * Update customer + */ + async update(requestParameters: UpdateCustomerRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateCustomerRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Expenses.ts b/sync-for-expenses/src/apis/Expenses.ts new file mode 100644 index 000000000..d21d58e4f --- /dev/null +++ b/sync-for-expenses/src/apis/Expenses.ts @@ -0,0 +1,148 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CreateExpenseResponse, + ErrorMessage, + ExpenseTransaction, + UpdateExpenseRequest, + UpdateExpenseResponse, +} from '../sdk/models/index'; +import { + CreateExpenseResponseFromJSON, + CreateExpenseResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + ExpenseTransactionFromJSON, + ExpenseTransactionToJSON, + UpdateExpenseRequestFromJSON, + UpdateExpenseRequestToJSON, + UpdateExpenseResponseFromJSON, + UpdateExpenseResponseToJSON, +} from '../sdk/models/index'; + +export interface CreateExpenseTransactionRequest { + companyId: string; + requestBody?: Array; +} + +export interface UpdateExpenseTransactionRequest { + companyId: string; + transactionId: string; + updateExpenseRequest?: UpdateExpenseRequest; +} + +/** + * + */ +export class Expenses extends runtime.BaseAPI { + + /** + * The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company\'s connection. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * Create expense transaction + */ + private async createExpenseTransactionRaw(requestParameters: CreateExpenseTransactionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createExpenseTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/expense-transactions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-expense-transaction', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody']!.map(ExpenseTransactionToJSON), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateExpenseResponseFromJSON(jsonValue)); + } + + /** + * The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company\'s connection. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * Create expense transaction + */ + async create(requestParameters: CreateExpenseTransactionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createExpenseTransactionRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company\'s connection. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. ### Supported integrations The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: | Integration | Supported | |-----------------------|-----------| | FreeAgent | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | #### Integration-specific behavior | Integration | Specifics | |-----------------------|-----------| | Sage Intacct | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.| + * Update expense transactions + */ + private async updateExpenseTransactionRaw(requestParameters: UpdateExpenseTransactionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateExpenseTransaction().' + ); + } + + if (requestParameters['transactionId'] == null) { + throw new runtime.RequiredError( + 'transactionId', + 'Required parameter "transactionId" was null or undefined when calling updateExpenseTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"transactionId"}}`, encodeURIComponent(String(requestParameters['transactionId']))), + method: 'PUT', + operationId: 'update-expense-transaction', + errorStatuses: [400, 401, 402, 403, 404, 422, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateExpenseRequestToJSON(requestParameters['updateExpenseRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateExpenseResponseFromJSON(jsonValue)); + } + + /** + * The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company\'s connection. [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. ### Supported integrations The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: | Integration | Supported | |-----------------------|-----------| | FreeAgent | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | #### Integration-specific behavior | Integration | Specifics | |-----------------------|-----------| | Sage Intacct | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.| + * Update expense transactions + */ + async update(requestParameters: UpdateExpenseTransactionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateExpenseTransactionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/ManageData.ts b/sync-for-expenses/src/apis/ManageData.ts new file mode 100644 index 000000000..e9724ba61 --- /dev/null +++ b/sync-for-expenses/src/apis/ManageData.ts @@ -0,0 +1,366 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import type { Company } from '../sdk/models/index'; +import type { Customers } from '../sdk/models/index'; +import type { Items } from '../sdk/models/index'; +import type { Suppliers } from '../sdk/models/index'; +import * as runtime from '../runtime'; +import type { DataType } from '../sdk/models/index'; +import type * as shared from '../sdk/models/index'; +import type { + DataStatuses, + ErrorMessage, + PullOperation, + PullOperations, +} from '../sdk/models/index'; +import { + DataStatusesFromJSON, + DataStatusesToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + PullOperationFromJSON, + PullOperationToJSON, + PullOperationsFromJSON, + PullOperationsToJSON, +} from '../sdk/models/index'; + +export interface GetDataStatusRequest { + companyId: string; +} + +export interface GetPullOperationRequest { + companyId: string; + datasetId: string; +} + +export interface ListPullOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface RefreshAllDataTypesRequest { + companyId: string; +} + +export interface RefreshDataTypeRequest { + companyId: string; + dataType: DataType; + connectionId?: string; +} + +/** + * + */ +export class ManageData extends runtime.BaseAPI { + + /** + * Get the state of each data type for a company + * Get data status + */ + private async getDataStatusRaw(requestParameters: GetDataStatusRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getDataStatus().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/dataStatus`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-data-status', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => DataStatusesFromJSON(jsonValue)); + } + + /** + * Get the state of each data type for a company + * Get data status + */ + async get(requestParameters: GetDataStatusRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getDataStatusRaw(requestParameters, options); + return await response.value(); + } + + /** + * Retrieve information about a single dataset or pull operation. + * Get pull operation + */ + private async getPullOperationRaw(requestParameters: GetPullOperationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getPullOperation().' + ); + } + + if (requestParameters['datasetId'] == null) { + throw new runtime.RequiredError( + 'datasetId', + 'Required parameter "datasetId" was null or undefined when calling getPullOperation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/history/{datasetId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"datasetId"}}`, encodeURIComponent(String(requestParameters['datasetId']))), + method: 'GET', + operationId: 'get-pull-operation', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationFromJSON(jsonValue)); + } + + /** + * Retrieve information about a single dataset or pull operation. + * Get pull operation + */ + async getPullOperation(requestParameters: GetPullOperationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getPullOperationRaw(requestParameters, options); + return await response.value(); + } + + /** + * Gets the pull operation history (datasets) for a given company. + * List pull operations + */ + private async listPullOperationsRaw(requestParameters: ListPullOperationsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listPullOperations().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/history`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-pull-operations', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationsFromJSON(jsonValue)); + } + + /** + * Gets the pull operation history (datasets) for a given company. + * List pull operations + */ + async listPullOperations(requestParameters: ListPullOperationsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listPullOperationsRaw(requestParameters, options); + return await response.value(); + } + + /** + * Refreshes all data types with `fetch on first link` set to `true` for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + * Refresh all data + */ + private async refreshAllDataTypesRaw(requestParameters: RefreshAllDataTypesRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling refreshAllDataTypes().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/all`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'refresh-all-data-types', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.VoidApiResponse(response); + } + + /** + * Refreshes all data types with `fetch on first link` set to `true` for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. + * Refresh all data + */ + async refreshAllDataTypes(requestParameters: RefreshAllDataTypesRequest, options?: runtime.RequestOptions): Promise { + await this.refreshAllDataTypesRaw(requestParameters, options); + } + + /** + * Refreshes a given data type for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + * Refresh data type + */ + private async refreshDataTypeRaw(requestParameters: RefreshDataTypeRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling refreshDataType().' + ); + } + + if (requestParameters['dataType'] == null) { + throw new runtime.RequiredError( + 'dataType', + 'Required parameter "dataType" was null or undefined when calling refreshDataType().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['connectionId'] != null) { + queryParameters['connectionId'] = requestParameters['connectionId']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/queue/{dataType}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"dataType"}}`, encodeURIComponent(String(requestParameters['dataType']))), + method: 'POST', + operationId: 'refresh-data-type', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PullOperationFromJSON(jsonValue)); + } + + /** + * Refreshes a given data type for a given company. This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. + * Refresh data type + */ + async refreshDataType(requestParameters: RefreshDataTypeRequest, options?: runtime.RequestOptions): Promise { + const response = await this.refreshDataTypeRaw(requestParameters, options); + return await response.value(); + } + +} + +/** + * @export + */ +export const RefreshDataTypeDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type RefreshDataTypeDataTypeEnum = typeof RefreshDataTypeDataTypeEnum[keyof typeof RefreshDataTypeDataTypeEnum]; diff --git a/sync-for-expenses/src/apis/MappingOptions.ts b/sync-for-expenses/src/apis/MappingOptions.ts new file mode 100644 index 000000000..428c3285b --- /dev/null +++ b/sync-for-expenses/src/apis/MappingOptions.ts @@ -0,0 +1,78 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + ErrorMessage, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + MappingOptionsFromJSON, + MappingOptionsToJSON, +} from '../sdk/models/index'; + +export interface GetMappingOptionsRequest { + companyId: string; +} + +/** + * + */ +export class MappingOptions extends runtime.BaseAPI { + + /** + * Gets the mapping options (accounts, trackingCategories and taxRates) for a company\'s accounting software + * Mapping options + */ + private async getMappingOptionsRaw(requestParameters: GetMappingOptionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getMappingOptions().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/mappingOptions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-mapping-options', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => MappingOptionsFromJSON(jsonValue)); + } + + /** + * Gets the mapping options (accounts, trackingCategories and taxRates) for a company\'s accounting software + * Mapping options + */ + async getMappingOptions(requestParameters: GetMappingOptionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getMappingOptionsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/PushOperations.ts b/sync-for-expenses/src/apis/PushOperations.ts new file mode 100644 index 000000000..bef95862c --- /dev/null +++ b/sync-for-expenses/src/apis/PushOperations.ts @@ -0,0 +1,160 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + ErrorMessage, + PushOperation, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + PushOperationFromJSON, + PushOperationToJSON, + PushOperationsFromJSON, + PushOperationsToJSON, +} from '../sdk/models/index'; + +export interface GetPushOperationRequest { + companyId: string; + pushOperationKey: string; +} + +export interface ListPushOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +/** + * + */ +export class PushOperations extends runtime.BaseAPI { + + /** + * Retrieve push operation. + * Get push operation + */ + private async getPushOperationRaw(requestParameters: GetPushOperationRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getPushOperation().' + ); + } + + if (requestParameters['pushOperationKey'] == null) { + throw new runtime.RequiredError( + 'pushOperationKey', + 'Required parameter "pushOperationKey" was null or undefined when calling getPushOperation().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/push/{pushOperationKey}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"pushOperationKey"}}`, encodeURIComponent(String(requestParameters['pushOperationKey']))), + method: 'GET', + operationId: 'get-push-operation', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOperationFromJSON(jsonValue)); + } + + /** + * Retrieve push operation. + * Get push operation + */ + async get(requestParameters: GetPushOperationRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getPushOperationRaw(requestParameters, options); + return await response.value(); + } + + /** + * List push operation records. + * List push operations + */ + private async listPushOperationsRaw(requestParameters: ListPushOperationsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listPushOperations().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/push`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-push-operations', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => PushOperationsFromJSON(jsonValue)); + } + + /** + * List push operation records. + * List push operations + */ + async list(requestParameters: ListPushOperationsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listPushOperationsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Reimbursements.ts b/sync-for-expenses/src/apis/Reimbursements.ts new file mode 100644 index 000000000..5953aa039 --- /dev/null +++ b/sync-for-expenses/src/apis/Reimbursements.ts @@ -0,0 +1,140 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { UpdateReimbursableExpenseTransactionRequest } from '../sdk/models/operations'; +import type { + CreateReimbursableExpenseResponse, + ErrorMessage, + ReimbursableExpenseTransaction, +} from '../sdk/models/index'; +import { + CreateReimbursableExpenseResponseFromJSON, + CreateReimbursableExpenseResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + ReimbursableExpenseTransactionFromJSON, + ReimbursableExpenseTransactionToJSON, + UpdateReimbursableExpenseTransactionRequestFromJSON, + UpdateReimbursableExpenseTransactionRequestToJSON, +} from '../sdk/models/index'; + +export interface CreateReimbursableExpenseTransactionRequest { + companyId: string; + requestBody?: Array; +} + + +/** + * + */ +export class Reimbursements extends runtime.BaseAPI { + + /** + * Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company\'s connection. [Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | FreeAgent | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Zoho Books | Yes | | Sage Intacct | Yes | + * Create reimbursable expense transaction + */ + private async createReimbursableExpenseTransactionRaw(requestParameters: CreateReimbursableExpenseTransactionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createReimbursableExpenseTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/reimbursable-expense-transactions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'POST', + operationId: 'create-reimbursable-expense-transaction', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: requestParameters['requestBody']!.map(ReimbursableExpenseTransactionToJSON), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateReimbursableExpenseResponseFromJSON(jsonValue)); + } + + /** + * Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company\'s connection. [Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | FreeAgent | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Zoho Books | Yes | | Sage Intacct | Yes | + * Create reimbursable expense transaction + */ + async create(requestParameters: CreateReimbursableExpenseTransactionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createReimbursableExpenseTransactionRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company\'s connection. Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Zoho Books | Yes | + * Update reimbursable expense transaction + */ + private async updateReimbursableExpenseTransactionRaw(requestParameters: UpdateReimbursableExpenseTransactionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateReimbursableExpenseTransaction().' + ); + } + + if (requestParameters['transactionId'] == null) { + throw new runtime.RequiredError( + 'transactionId', + 'Required parameter "transactionId" was null or undefined when calling updateReimbursableExpenseTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/reimbursable-expense-transactions/{transactionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"transactionId"}}`, encodeURIComponent(String(requestParameters['transactionId']))), + method: 'PUT', + operationId: 'update-reimbursable-expense-transaction', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: UpdateReimbursableExpenseTransactionRequestToJSON(requestParameters['updateReimbursableExpenseTransactionRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateReimbursableExpenseResponseFromJSON(jsonValue)); + } + + /** + * The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company\'s connection. Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). ### Supported Integrations | Integration | Supported | |-----------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Oracle NetSuite | Yes | | Zoho Books | Yes | + * Update reimbursable expense transaction + */ + async update(requestParameters: UpdateReimbursableExpenseTransactionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateReimbursableExpenseTransactionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Suppliers.ts b/sync-for-expenses/src/apis/Suppliers.ts new file mode 100644 index 000000000..9aa137860 --- /dev/null +++ b/sync-for-expenses/src/apis/Suppliers.ts @@ -0,0 +1,322 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type * as shared from '../sdk/models/index'; +import type { + CreateSupplierResponse, + ErrorMessage, + Supplier, + UpdateSupplierResponse, +} from '../sdk/models/index'; +import { + CreateSupplierResponseFromJSON, + CreateSupplierResponseToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, + SupplierFromJSON, + SupplierToJSON, + SuppliersFromJSON, + SuppliersToJSON, + UpdateSupplierResponseFromJSON, + UpdateSupplierResponseToJSON, +} from '../sdk/models/index'; + +export interface CreateSupplierRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + supplier?: Supplier; +} + +export interface GetSupplierRequest { + companyId: string; + supplierId: string; +} + +export interface ListSuppliersRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; +} + +export interface UpdateSupplierRequest { + companyId: string; + connectionId: string; + supplierId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + forceUpdate?: boolean; + supplier?: Supplier; +} + +/** + * + */ +export class Suppliers extends runtime.BaseAPI { + + /** + * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | Oracle NetSuite | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * Create supplier + */ + private async createSupplierRaw(requestParameters: CreateSupplierRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createSupplier().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling createSupplier().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/suppliers`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))), + method: 'POST', + operationId: 'create-supplier', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SupplierToJSON(requestParameters['supplier']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CreateSupplierResponseFromJSON(jsonValue)); + } + + /** + * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | Oracle NetSuite | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * Create supplier + */ + async create(requestParameters: CreateSupplierRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createSupplierRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Get supplier* endpoint returns a single supplier for a given supplierId. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | Oracle NetSuite | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * Get supplier + */ + private async getSupplierRaw(requestParameters: GetSupplierRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getSupplier().' + ); + } + + if (requestParameters['supplierId'] == null) { + throw new runtime.RequiredError( + 'supplierId', + 'Required parameter "supplierId" was null or undefined when calling getSupplier().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/suppliers/{supplierId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"supplierId"}}`, encodeURIComponent(String(requestParameters['supplierId']))), + method: 'GET', + operationId: 'get-supplier', + errorStatuses: [401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SupplierFromJSON(jsonValue)); + } + + /** + * The *Get supplier* endpoint returns a single supplier for a given supplierId. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | Oracle NetSuite | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * Get supplier + */ + async get(requestParameters: GetSupplierRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getSupplierRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | Oracle NetSuite | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * List suppliers + */ + private async listSuppliersRaw(requestParameters: ListSuppliersRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listSuppliers().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + if (requestParameters['query'] != null) { + queryParameters['query'] = requestParameters['query']; + } + + if (requestParameters['orderBy'] != null) { + queryParameters['orderBy'] = requestParameters['orderBy']; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/data/suppliers`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-suppliers', + errorStatuses: [400, 401, 402, 403, 404, 409, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => SuppliersFromJSON(jsonValue)); + } + + /** + * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). ### Supported Integrations | Integration | Supported | |-------------------------------|-----------| | Dynamics 365 Business Central | Yes | | FreeAgent | Yes | | Oracle NetSuite | Yes | | QuickBooks Desktop | Yes | | QuickBooks Online | Yes | | Sage Intacct | Yes | | Xero | Yes | | Zoho Books | Yes | + * List suppliers + */ + async list(requestParameters: ListSuppliersRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listSuppliersRaw(requestParameters, options); + return await response.value(); + } + + /** + * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). ### Supported Integrations | Integration | Supported | |-------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | + * Update supplier + */ + private async updateSupplierRaw(requestParameters: UpdateSupplierRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling updateSupplier().' + ); + } + + if (requestParameters['connectionId'] == null) { + throw new runtime.RequiredError( + 'connectionId', + 'Required parameter "connectionId" was null or undefined when calling updateSupplier().' + ); + } + + if (requestParameters['supplierId'] == null) { + throw new runtime.RequiredError( + 'supplierId', + 'Required parameter "supplierId" was null or undefined when calling updateSupplier().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['timeoutInMinutes'] != null) { + queryParameters['timeoutInMinutes'] = requestParameters['timeoutInMinutes']; + } + + if (requestParameters['allowSyncOnPushComplete'] != null) { + queryParameters['allowSyncOnPushComplete'] = requestParameters['allowSyncOnPushComplete']; + } + else { + queryParameters['allowSyncOnPushComplete'] = true; + } + + if (requestParameters['forceUpdate'] != null) { + queryParameters['forceUpdate'] = requestParameters['forceUpdate']; + } + else { + queryParameters['forceUpdate'] = false; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"connectionId"}}`, encodeURIComponent(String(requestParameters['connectionId']))).replace(`{${"supplierId"}}`, encodeURIComponent(String(requestParameters['supplierId']))), + method: 'PUT', + operationId: 'update-supplier', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: SupplierToJSON(requestParameters['supplier']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => UpdateSupplierResponseFromJSON(jsonValue)); + } + + /** + * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company\'s connection. [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. **Integration-specific behavior** Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). ### Supported Integrations | Integration | Supported | |-------------------|-----------| | FreeAgent | Yes | | QuickBooks Online | Yes | | Xero | Yes | + * Update supplier + */ + async update(requestParameters: UpdateSupplierRequest, options?: runtime.RequestOptions): Promise { + const response = await this.updateSupplierRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Sync.ts b/sync-for-expenses/src/apis/Sync.ts new file mode 100644 index 000000000..1511408e0 --- /dev/null +++ b/sync-for-expenses/src/apis/Sync.ts @@ -0,0 +1,221 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + CompanySyncStatus, + ErrorMessage, +} from '../sdk/models/index'; +import { + CompanySyncStatusFromJSON, + CompanySyncStatusToJSON, + ErrorMessageFromJSON, + ErrorMessageToJSON, +} from '../sdk/models/index'; + +export interface GetLastSuccessfulSyncRequest { + companyId: string; +} + +export interface GetLatestSyncRequest { + companyId: string; +} + +export interface GetSyncByIdRequest { + companyId: string; + syncId: string; +} + +export interface ListSyncsRequest { + companyId: string; +} + +/** + * + */ +export class Sync extends runtime.BaseAPI { + + /** + * Gets the status of the last successful sync + * Last successful sync + */ + private async getLastSuccessfulSyncRaw(requestParameters: GetLastSuccessfulSyncRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getLastSuccessfulSync().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/lastSuccessful/status`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-last-successful-sync', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanySyncStatusFromJSON(jsonValue)); + } + + /** + * Gets the status of the last successful sync + * Last successful sync + */ + async getLastSuccessfulSync(requestParameters: GetLastSuccessfulSyncRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getLastSuccessfulSyncRaw(requestParameters, options); + return await response.value(); + } + + /** + * Gets the latest sync status + * Latest sync status + */ + private async getLatestSyncRaw(requestParameters: GetLatestSyncRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getLatestSync().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/latest/status`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'get-latest-sync', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanySyncStatusFromJSON(jsonValue)); + } + + /** + * Gets the latest sync status + * Latest sync status + */ + async getLatestSync(requestParameters: GetLatestSyncRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getLatestSyncRaw(requestParameters, options); + return await response.value(); + } + + /** + * Get the sync status for a specified sync + * Get sync status + */ + private async getSyncByIdRaw(requestParameters: GetSyncByIdRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getSyncById().' + ); + } + + if (requestParameters['syncId'] == null) { + throw new runtime.RequiredError( + 'syncId', + 'Required parameter "syncId" was null or undefined when calling getSyncById().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/{syncId}/status`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"syncId"}}`, encodeURIComponent(String(requestParameters['syncId']))), + method: 'GET', + operationId: 'get-sync-by-id', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => CompanySyncStatusFromJSON(jsonValue)); + } + + /** + * Get the sync status for a specified sync + * Get sync status + */ + async get(requestParameters: GetSyncByIdRequest, options?: runtime.RequestOptions): Promise { + const response = await this.getSyncByIdRaw(requestParameters, options); + return await response.value(); + } + + /** + * Gets a list of sync statuses + * List sync statuses + */ + private async listSyncsRaw(requestParameters: ListSyncsRequest, options?: runtime.RequestOptions): Promise>> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listSyncs().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/list/status`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))), + method: 'GET', + operationId: 'list-syncs', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(CompanySyncStatusFromJSON)); + } + + /** + * Gets a list of sync statuses + * List sync statuses + */ + async list(requestParameters: ListSyncsRequest, options?: runtime.RequestOptions): Promise> { + const response = await this.listSyncsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/TransactionStatus.ts b/sync-for-expenses/src/apis/TransactionStatus.ts new file mode 100644 index 000000000..1a8963cf6 --- /dev/null +++ b/sync-for-expenses/src/apis/TransactionStatus.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + Transaction, + Transactions, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + TransactionFromJSON, + TransactionToJSON, + TransactionsFromJSON, + TransactionsToJSON, +} from '../sdk/models/index'; + +export interface GetSyncTransactionRequest { + companyId: string; + syncId: string; + transactionId: string; +} + +export interface ListSyncTransactionsRequest { + companyId: string; + syncId: string; + page?: number; + pageSize?: number; +} + +/** + * + */ +export class TransactionStatus extends runtime.BaseAPI { + + /** + * Gets the status of a transaction for a sync + * Get sync transaction + */ + private async getSyncTransactionRaw(requestParameters: GetSyncTransactionRequest, options?: runtime.RequestOptions): Promise>> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling getSyncTransaction().' + ); + } + + if (requestParameters['syncId'] == null) { + throw new runtime.RequiredError( + 'syncId', + 'Required parameter "syncId" was null or undefined when calling getSyncTransaction().' + ); + } + + if (requestParameters['transactionId'] == null) { + throw new runtime.RequiredError( + 'transactionId', + 'Required parameter "transactionId" was null or undefined when calling getSyncTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"syncId"}}`, encodeURIComponent(String(requestParameters['syncId']))).replace(`{${"transactionId"}}`, encodeURIComponent(String(requestParameters['transactionId']))), + method: 'GET', + operationId: 'get-sync-transaction', + errorStatuses: [401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TransactionFromJSON)); + } + + /** + * Gets the status of a transaction for a sync + * Get sync transaction + */ + async get(requestParameters: GetSyncTransactionRequest, options?: runtime.RequestOptions): Promise> { + const response = await this.getSyncTransactionRaw(requestParameters, options); + return await response.value(); + } + + /** + * Gets the transactions and status for a sync + * List sync transactions + */ + private async listSyncTransactionsRaw(requestParameters: ListSyncTransactionsRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling listSyncTransactions().' + ); + } + + if (requestParameters['syncId'] == null) { + throw new runtime.RequiredError( + 'syncId', + 'Required parameter "syncId" was null or undefined when calling listSyncTransactions().' + ); + } + + const queryParameters: any = {}; + + if (requestParameters['page'] != null) { + queryParameters['page'] = requestParameters['page']; + } + else { + queryParameters['page'] = 1; + } + + if (requestParameters['pageSize'] != null) { + queryParameters['pageSize'] = requestParameters['pageSize']; + } + else { + queryParameters['pageSize'] = 100; + } + + const headerParameters: runtime.HTTPHeaders = {}; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"syncId"}}`, encodeURIComponent(String(requestParameters['syncId']))), + method: 'GET', + operationId: 'list-sync-transactions', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransactionsFromJSON(jsonValue)); + } + + /** + * Gets the transactions and status for a sync + * List sync transactions + */ + async list(requestParameters: ListSyncTransactionsRequest, options?: runtime.RequestOptions): Promise { + const response = await this.listSyncTransactionsRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/Transfers.ts b/sync-for-expenses/src/apis/Transfers.ts new file mode 100644 index 000000000..d64becc3e --- /dev/null +++ b/sync-for-expenses/src/apis/Transfers.ts @@ -0,0 +1,93 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import * as runtime from '../runtime'; +import type { + ErrorMessage, + TransferTransactionRequest, + TransferTransactionResponse, +} from '../sdk/models/index'; +import { + ErrorMessageFromJSON, + ErrorMessageToJSON, + TransferTransactionRequestFromJSON, + TransferTransactionRequestToJSON, + TransferTransactionResponseFromJSON, + TransferTransactionResponseToJSON, +} from '../sdk/models/index'; + +export interface CreateTransferTransactionRequest { + companyId: string; + transactionId: string; + transferTransactionRequest?: TransferTransactionRequest; +} + +/** + * + */ +export class Transfers extends runtime.BaseAPI { + + /** + * Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company\'s connection. Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. The `from.amount` and `to.amount` fields are in the native currency of the account. ### Supported Integrations | Integration | Create transfer | Update transfer | |-----------------------|------------------|------------------| | Dynamics | No | No | | FreeAgent | Yes | Yes | | NetSuite | No | No | | QuickBooks Desktop | Yes | No | | QuickBooks Online | Yes | Yes | | Sage Intacct | No | No | | Xero | Yes | No | | Zoho Books | No | No | + * Create transfer transaction + */ + private async createTransferTransactionRaw(requestParameters: CreateTransferTransactionRequest, options?: runtime.RequestOptions): Promise> { + if (requestParameters['companyId'] == null) { + throw new runtime.RequiredError( + 'companyId', + 'Required parameter "companyId" was null or undefined when calling createTransferTransaction().' + ); + } + + if (requestParameters['transactionId'] == null) { + throw new runtime.RequiredError( + 'transactionId', + 'Required parameter "transactionId" was null or undefined when calling createTransferTransaction().' + ); + } + + const queryParameters: any = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + headerParameters['Content-Type'] = 'application/json'; + + if (this.configuration && this.configuration.apiKey) { + headerParameters["Authorization"] = await this.configuration.apiKey("Authorization"); // auth_header authentication + } + + const response = await this.request({ + path: `/companies/{companyId}/sync/expenses/transfer-transactions/{transactionId}`.replace(`{${"companyId"}}`, encodeURIComponent(String(requestParameters['companyId']))).replace(`{${"transactionId"}}`, encodeURIComponent(String(requestParameters['transactionId']))), + method: 'PUT', + operationId: 'create-transfer-transaction', + errorStatuses: [400, 401, 402, 403, 404, 429, 500, 503, ], + headers: headerParameters, + query: queryParameters, + body: TransferTransactionRequestToJSON(requestParameters['transferTransactionRequest']), + }, options); + + return new runtime.JSONApiResponse(response, (jsonValue) => TransferTransactionResponseFromJSON(jsonValue)); + } + + /** + * Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company\'s connection. Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. The `from.amount` and `to.amount` fields are in the native currency of the account. ### Supported Integrations | Integration | Create transfer | Update transfer | |-----------------------|------------------|------------------| | Dynamics | No | No | | FreeAgent | Yes | Yes | | NetSuite | No | No | | QuickBooks Desktop | Yes | No | | QuickBooks Online | Yes | Yes | | Sage Intacct | No | No | | Xero | Yes | No | | Zoho Books | No | No | + * Create transfer transaction + */ + async create(requestParameters: CreateTransferTransactionRequest, options?: runtime.RequestOptions): Promise { + const response = await this.createTransferTransactionRaw(requestParameters, options); + return await response.value(); + } + +} diff --git a/sync-for-expenses/src/apis/index.ts b/sync-for-expenses/src/apis/index.ts new file mode 100644 index 000000000..6e036630e --- /dev/null +++ b/sync-for-expenses/src/apis/index.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Accounts'; +export * from './Adjustments'; +export * from './Attachments'; +export * from './BankAccounts'; +export * from './Companies'; +export * from './CompanyInfo'; +export * from './Configuration'; +export * from './Connections'; +export * from './Customers'; +export * from './Expenses'; +export * from './ManageData'; +export * from './MappingOptions'; +export * from './PushOperations'; +export * from './Reimbursements'; +export * from './Suppliers'; +export * from './Sync'; +export * from './TransactionStatus'; +export * from './Transfers'; diff --git a/sync-for-expenses/src/core.ts b/sync-for-expenses/src/core.ts index a84bafdec..55a39ccab 100644 --- a/sync-for-expenses/src/core.ts +++ b/sync-for-expenses/src/core.ts @@ -1,13 +1,4 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { ClientSDK } from "./lib/sdks.js"; - -/** - * A minimal client to use when calling standalone SDK functions. Typically, an - * instance of this class would be instantiated once at the start of an - * application and passed around through some dependency injection mechanism to - * parts of an application that need to make SDK calls. - */ -export class CodatSyncExpensesCore extends ClientSDK {} +export { CodatSyncExpenses, CodatSyncExpenses as CodatSyncExpensesCore } from './sdk'; diff --git a/sync-for-expenses/src/funcs/_adapter.ts b/sync-for-expenses/src/funcs/_adapter.ts new file mode 100644 index 000000000..56e5acd53 --- /dev/null +++ b/sync-for-expenses/src/funcs/_adapter.ts @@ -0,0 +1,13 @@ +/* tslint:disable */ +/* eslint-disable */ + +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; + +export async function toResult(call: () => Promise): Promise> { + try { + return OK(await call()); + } catch (err) { + return ERR(err instanceof Error ? err : new Error(String(err))); + } +} diff --git a/sync-for-expenses/src/funcs/accountsCreate.ts b/sync-for-expenses/src/funcs/accountsCreate.ts index f60bd8bf5..4b9545689 100644 --- a/sync-for-expenses/src/funcs/accountsCreate.ts +++ b/sync-for-expenses/src/funcs/accountsCreate.ts @@ -1,219 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create account - * - * @remarks - * The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. - * - * [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). - */ -export function accountsCreate( - client: CodatSyncExpensesCore, - request: operations.CreateAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateAccountResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateAccountResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.accountPrototype, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/accounts", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-account", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["accounts"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateAccountResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateAccountResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function accountsCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.accounts.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/accountsGetCreateModel.ts b/sync-for-expenses/src/funcs/accountsGetCreateModel.ts index de4cf0e95..d51386b36 100644 --- a/sync-for-expenses/src/funcs/accountsGetCreateModel.ts +++ b/sync-for-expenses/src/funcs/accountsGetCreateModel.ts @@ -1,201 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get create account model - * - * @remarks - * The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. - * - * [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ -export function accountsGetCreateModel( - client: CodatSyncExpensesCore, - request: operations.GetCreateChartOfAccountsModelRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetCreateChartOfAccountsModelRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCreateChartOfAccountsModelRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/options/chartOfAccounts", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-create-chartOfAccounts-model", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["accounts"]["getCreateModel"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOption, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOption$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function accountsGetCreateModel( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.accounts.getCreateModel(request, options))); } diff --git a/sync-for-expenses/src/funcs/adjustmentsCreate.ts b/sync-for-expenses/src/funcs/adjustmentsCreate.ts index e123669ff..e808ce350 100644 --- a/sync-for-expenses/src/funcs/adjustmentsCreate.ts +++ b/sync-for-expenses/src/funcs/adjustmentsCreate.ts @@ -1,212 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create adjustment transaction - * - * @remarks - * Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. - * - * Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-----------------------|-----------| - * | QuickBooks Desktop | Yes | - */ -export function adjustmentsCreate( - client: CodatSyncExpensesCore, - request: operations.CreateAdjustmentTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.AdjustmentTransactionResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateAdjustmentTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.AdjustmentTransactionResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateAdjustmentTransactionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/adjustment-transactions", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-adjustment-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["adjustments"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.AdjustmentTransactionResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.AdjustmentTransactionResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function adjustmentsCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.adjustments.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/attachmentsUpload.ts b/sync-for-expenses/src/funcs/attachmentsUpload.ts index fe6c477b3..d2966e634 100644 --- a/sync-for-expenses/src/funcs/attachmentsUpload.ts +++ b/sync-for-expenses/src/funcs/attachmentsUpload.ts @@ -1,265 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { appendForm, encodeSimple, normalizeBlob } from "../lib/encodings.js"; -import { - bytesToBlob, - getContentTypeFromFileName, - readableStreamToArrayBuffer, -} from "../lib/files.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { isBlobLike } from "../sdk/types/blobs.js"; -import { Result } from "../sdk/types/fp.js"; -import { isReadableStream } from "../sdk/types/streams.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Upload attachment - * - * @remarks - * The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. - * - * [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. - * - * **Integration-specific behavior** - * - * Each accounting software supports different file formats and sizes. - * - * | Integration | File size | File extension | Supported transactions | - * |-----------------------------------|-----------|-------------------------------------------------------|------------------------| - * | **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | - * | **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `expense-transactions.Payment`, `expense-transactions.Refund`, `reimbursable-expense-transactions` | - * | **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`expense-transactions.Payment`, `expense-transactions.Refund` | - * | **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types - * | **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | - * | **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` - * | **Zoho Books** | 5MB | GIF, PNG, JPEG, JPG, BMP, PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | - */ -export function attachmentsUpload( - client: CodatSyncExpensesCore, - request: operations.UploadExpenseAttachmentRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Attachment, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UploadExpenseAttachmentRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Attachment, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UploadExpenseAttachmentRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = new FormData(); - if (payload.AttachmentUpload != null) { - if (isBlobLike(payload.AttachmentUpload.file)) { - const file = payload.AttachmentUpload.file; - const blob = await normalizeBlob(file); - const name = "name" in file ? (file.name as string) : undefined; - appendForm(body, "file", blob, name); - } else if (isReadableStream(payload.AttachmentUpload.file.content)) { - const buffer = await readableStreamToArrayBuffer( - payload.AttachmentUpload.file.content, - ); - const contentType = - getContentTypeFromFileName(payload.AttachmentUpload.file.fileName) - || "application/octet-stream"; - appendForm( - body, - "file", - bytesToBlob(buffer, contentType), - payload.AttachmentUpload.file.fileName, - ); - } else { - const contentType = - getContentTypeFromFileName(payload.AttachmentUpload.file.fileName) - || "application/octet-stream"; - appendForm( - body, - "file", - bytesToBlob(payload.AttachmentUpload.file.content, contentType), - payload.AttachmentUpload.file.fileName, - ); - } - } - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - syncId: encodeSimple("syncId", payload.syncId, { - explode: false, - charEncoding: "percent", - }), - transactionId: encodeSimple("transactionId", payload.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}/attachments", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "upload-expense-attachment", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["attachments"]["upload"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Attachment, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Attachment$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function attachmentsUpload( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.attachments.upload(request, options))); } diff --git a/sync-for-expenses/src/funcs/bankAccountsCreate.ts b/sync-for-expenses/src/funcs/bankAccountsCreate.ts index 74bb9f5a6..e52955982 100644 --- a/sync-for-expenses/src/funcs/bankAccountsCreate.ts +++ b/sync-for-expenses/src/funcs/bankAccountsCreate.ts @@ -1,219 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create bank account - * - * @remarks - * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). - */ -export function bankAccountsCreate( - client: CodatSyncExpensesCore, - request: operations.CreateBankAccountRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateBankAccountResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateBankAccountRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateBankAccountResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateBankAccountRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.BankAccount, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/bankAccounts", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-bank-account", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["bankAccounts"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateBankAccountResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateBankAccountResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function bankAccountsCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bankAccounts.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/bankAccountsGetCreateModel.ts b/sync-for-expenses/src/funcs/bankAccountsGetCreateModel.ts index fc344513b..ec63d8240 100644 --- a/sync-for-expenses/src/funcs/bankAccountsGetCreateModel.ts +++ b/sync-for-expenses/src/funcs/bankAccountsGetCreateModel.ts @@ -1,199 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get create bank account model - * - * @remarks - * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. - * - * [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ -export function bankAccountsGetCreateModel( - client: CodatSyncExpensesCore, - request: operations.GetCreateBankAccountsModelRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetCreateBankAccountsModelRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOption, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCreateBankAccountsModelRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/options/bankAccounts", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-create-bankAccounts-model", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["bankAccounts"]["getCreateModel"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOption, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOption$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function bankAccountsGetCreateModel( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.bankAccounts.getCreateModel(request, options))); } diff --git a/sync-for-expenses/src/funcs/companiesCreate.ts b/sync-for-expenses/src/funcs/companiesCreate.ts index db65a6aa6..606ebb345 100644 --- a/sync-for-expenses/src/funcs/companiesCreate.ts +++ b/sync-for-expenses/src/funcs/companiesCreate.ts @@ -1,187 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - */ -export function companiesCreate( - client: CodatSyncExpensesCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => shared.CompanyRequestBody$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = payload === undefined - ? null - : encodeJSON("body", payload, { explode: true }); - - const path = pathToFunc("/companies")(); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-company", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companies"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["400", "401", "402", "403", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([400, 401, 402, 403, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesCreate( + client: CodatSyncExpensesCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/companiesDelete.ts b/sync-for-expenses/src/funcs/companiesDelete.ts index 54b84aea9..b2c9ded3e 100644 --- a/sync-for-expenses/src/funcs/companiesDelete.ts +++ b/sync-for-expenses/src/funcs/companiesDelete.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - */ -export function companiesDelete( - client: CodatSyncExpensesCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.DeleteCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-company", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companies"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesDelete( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.delete(request, options))); } diff --git a/sync-for-expenses/src/funcs/companiesGet.ts b/sync-for-expenses/src/funcs/companiesGet.ts index 82cfafe4e..47344f77e 100644 --- a/sync-for-expenses/src/funcs/companiesGet.ts +++ b/sync-for-expenses/src/funcs/companiesGet.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - */ -export function companiesGet( - client: CodatSyncExpensesCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companies"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/companiesList.ts b/sync-for-expenses/src/funcs/companiesList.ts index 6c11b88fd..92e92cc7b 100644 --- a/sync-for-expenses/src/funcs/companiesList.ts +++ b/sync-for-expenses/src/funcs/companiesList.ts @@ -1,220 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ -export function companiesList( - client: CodatSyncExpensesCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): APIPromise< - Result< - shared.Companies, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Companies, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListCompaniesRequest$outboundSchema.optional().parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const path = pathToFunc("/companies")(); - - const query = encodeFormQuery({ - "orderBy": payload?.orderBy, - "page": payload?.page, - "pageSize": payload?.pageSize, - "query": payload?.query, - "tags": payload?.tags, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-companies", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companies"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Companies, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Companies$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesList( + client: CodatSyncExpensesCore, + request?: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/companiesReplace.ts b/sync-for-expenses/src/funcs/companiesReplace.ts index c654e336e..186b83946 100644 --- a/sync-for-expenses/src/funcs/companiesReplace.ts +++ b/sync-for-expenses/src/funcs/companiesReplace.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - */ -export function companiesReplace( - client: CodatSyncExpensesCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ReplaceCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyRequestBody, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "replace-company", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companies"]["replace"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesReplace( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.replace(request, options))); } diff --git a/sync-for-expenses/src/funcs/companiesUpdate.ts b/sync-for-expenses/src/funcs/companiesUpdate.ts index 0be2e7bfb..b4b7fa2f7 100644 --- a/sync-for-expenses/src/funcs/companiesUpdate.ts +++ b/sync-for-expenses/src/funcs/companiesUpdate.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - */ -export function companiesUpdate( - client: CodatSyncExpensesCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UpdateCompanyRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateCompanyRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyUpdateRequest, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-company", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companies"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Company, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Company$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companiesUpdate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companies.update(request, options))); } diff --git a/sync-for-expenses/src/funcs/companyInfoGet.ts b/sync-for-expenses/src/funcs/companyInfoGet.ts index a476e46c5..074ffd6cb 100644 --- a/sync-for-expenses/src/funcs/companyInfoGet.ts +++ b/sync-for-expenses/src/funcs/companyInfoGet.ts @@ -1,200 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company info - * - * @remarks - * Gets the latest basic info for a company. - */ -export function companyInfoGet( - client: CodatSyncExpensesCore, - request: operations.GetCompanyInfoRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetCompanyInfoRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCompanyInfoRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/info")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-info", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["companyInfo"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyInformation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyInformation$inboundSchema), - M.jsonErr( - [401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function companyInfoGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.companyInfo.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/configurationGet.ts b/sync-for-expenses/src/funcs/configurationGet.ts index e3a57710c..5569c2f73 100644 --- a/sync-for-expenses/src/funcs/configurationGet.ts +++ b/sync-for-expenses/src/funcs/configurationGet.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get company configuration - * - * @remarks - * Gets a company's expense sync configuration - */ -export function configurationGet( - client: CodatSyncExpensesCore, - request: operations.GetCompanyConfigurationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyConfiguration, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetCompanyConfigurationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyConfiguration, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetCompanyConfigurationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/sync/expenses/config")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-company-configuration", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["configuration"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyConfiguration, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyConfiguration$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function configurationGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.configuration.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/configurationSet.ts b/sync-for-expenses/src/funcs/configurationSet.ts index c43d0ff4c..27dc0c012 100644 --- a/sync-for-expenses/src/funcs/configurationSet.ts +++ b/sync-for-expenses/src/funcs/configurationSet.ts @@ -1,206 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Set company configuration - * - * @remarks - * Sets a company's expense sync configuration - */ -export function configurationSet( - client: CodatSyncExpensesCore, - request: operations.SetCompanyConfigurationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanyConfiguration, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.SetCompanyConfigurationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanyConfiguration, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.SetCompanyConfigurationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.CompanyConfiguration, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/sync/expenses/config")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "set-company-configuration", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["configuration"]["set"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanyConfiguration, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanyConfiguration$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function configurationSet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.configuration.set(request, options))); } diff --git a/sync-for-expenses/src/funcs/connectionsCreate.ts b/sync-for-expenses/src/funcs/connectionsCreate.ts index 0d71d66f9..75325444d 100644 --- a/sync-for-expenses/src/funcs/connectionsCreate.ts +++ b/sync-for-expenses/src/funcs/connectionsCreate.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create connection - * - * @remarks - * Creates a connection for the company by providing a valid `platformKey`. - * - * Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - */ -export function connectionsCreate( - client: CodatSyncExpensesCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-connection", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["connections"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/connectionsCreatePartnerExpenseConnection.ts b/sync-for-expenses/src/funcs/connectionsCreatePartnerExpenseConnection.ts index d56f17b0f..bfe722fa0 100644 --- a/sync-for-expenses/src/funcs/connectionsCreatePartnerExpenseConnection.ts +++ b/sync-for-expenses/src/funcs/connectionsCreatePartnerExpenseConnection.ts @@ -1,205 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create partner expense connection - * - * @remarks - * Creates a partner expense data connection - */ -export function connectionsCreatePartnerExpenseConnection( - client: CodatSyncExpensesCore, - request: operations.CreatePartnerExpenseConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreatePartnerExpenseConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreatePartnerExpenseConnectionRequest$outboundSchema.parse( - value, - ), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/connections/partnerExpense", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-partner-expense-connection", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["connections"]["createPartnerExpenseConnection"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsCreatePartnerExpenseConnection( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.createPartnerExpenseConnection(request, options))); } diff --git a/sync-for-expenses/src/funcs/connectionsDelete.ts b/sync-for-expenses/src/funcs/connectionsDelete.ts index 3f2c7c764..b5bd6503c 100644 --- a/sync-for-expenses/src/funcs/connectionsDelete.ts +++ b/sync-for-expenses/src/funcs/connectionsDelete.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Delete connection - * - * @remarks - * 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. - */ -export function connectionsDelete( - client: CodatSyncExpensesCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.DeleteConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.DeleteConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "delete-connection", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["connections"]["delete"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "DELETE", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(200, z.void()), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsDelete( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.delete(request, options))); } diff --git a/sync-for-expenses/src/funcs/connectionsGet.ts b/sync-for-expenses/src/funcs/connectionsGet.ts index f563555dd..c7d240daf 100644 --- a/sync-for-expenses/src/funcs/connectionsGet.ts +++ b/sync-for-expenses/src/funcs/connectionsGet.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get connection - * - * @remarks - * 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. - */ -export function connectionsGet( - client: CodatSyncExpensesCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-connection", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["connections"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/connectionsList.ts b/sync-for-expenses/src/funcs/connectionsList.ts index 3ae05a958..c003e5910 100644 --- a/sync-for-expenses/src/funcs/connectionsList.ts +++ b/sync-for-expenses/src/funcs/connectionsList.ts @@ -1,208 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List connections - * - * @remarks - * List the connections for a company. - */ -export function connectionsList( - client: CodatSyncExpensesCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connections, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListConnectionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connections, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListConnectionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-connections", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["connections"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connections, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connections$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsList( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/connectionsUnlink.ts b/sync-for-expenses/src/funcs/connectionsUnlink.ts index df877b4bc..a985d65b1 100644 --- a/sync-for-expenses/src/funcs/connectionsUnlink.ts +++ b/sync-for-expenses/src/funcs/connectionsUnlink.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Unlink connection - * - * @remarks - * 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. - */ -export function connectionsUnlink( - client: CodatSyncExpensesCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UnlinkConnectionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/connections/{connectionId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "unlink-connection", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["connections"]["unlink"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PATCH", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Connection, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Connection$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function connectionsUnlink( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.connections.unlink(request, options))); } diff --git a/sync-for-expenses/src/funcs/customersCreate.ts b/sync-for-expenses/src/funcs/customersCreate.ts index 6622d5c14..64436344b 100644 --- a/sync-for-expenses/src/funcs/customersCreate.ts +++ b/sync-for-expenses/src/funcs/customersCreate.ts @@ -1,219 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create customer - * - * @remarks - * The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - */ -export function customersCreate( - client: CodatSyncExpensesCore, - request: operations.CreateCustomerRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateCustomerResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateCustomerRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateCustomerResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateCustomerRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.Customer, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/customers", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-customer", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["customers"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateCustomerResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateCustomerResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customersCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customers.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/customersGet.ts b/sync-for-expenses/src/funcs/customersGet.ts index 83bd2c13b..def64742c 100644 --- a/sync-for-expenses/src/funcs/customersGet.ts +++ b/sync-for-expenses/src/funcs/customersGet.ts @@ -1,210 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get customer - * - * @remarks - * The *Get customer* endpoint returns a single customer for a given customerId. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - */ -export function customersGet( - client: CodatSyncExpensesCore, - request: operations.GetCustomerRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Customer, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetCustomerRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Customer, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetCustomerRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - customerId: encodeSimple("customerId", payload.customerId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/customers/{customerId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-customer", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["customers"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Customer, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Customer$inboundSchema), - M.jsonErr( - [401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customersGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customers.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/customersList.ts b/sync-for-expenses/src/funcs/customersList.ts index ac28d2ec7..882b4fbae 100644 --- a/sync-for-expenses/src/funcs/customersList.ts +++ b/sync-for-expenses/src/funcs/customersList.ts @@ -1,213 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List customers - * - * @remarks - * The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - */ -export function customersList( - client: CodatSyncExpensesCore, - request: operations.ListCustomersRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Customers, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListCustomersRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Customers, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListCustomersRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/customers")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-customers", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["customers"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Customers, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Customers$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customersList( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customers.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/customersUpdate.ts b/sync-for-expenses/src/funcs/customersUpdate.ts index 25137e043..edde84d6e 100644 --- a/sync-for-expenses/src/funcs/customersUpdate.ts +++ b/sync-for-expenses/src/funcs/customersUpdate.ts @@ -1,224 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update customer - * - * @remarks - * The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - */ -export function customersUpdate( - client: CodatSyncExpensesCore, - request: operations.UpdateCustomerRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.UpdateCustomerResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UpdateCustomerRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.UpdateCustomerResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateCustomerRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.Customer, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - customerId: encodeSimple("customerId", payload.customerId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/customers/{customerId}", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "forceUpdate": payload.forceUpdate, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-customer", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["customers"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.UpdateCustomerResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.UpdateCustomerResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function customersUpdate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.customers.update(request, options))); } diff --git a/sync-for-expenses/src/funcs/expensesCreate.ts b/sync-for-expenses/src/funcs/expensesCreate.ts index 2d18fa86d..d4e63e111 100644 --- a/sync-for-expenses/src/funcs/expensesCreate.ts +++ b/sync-for-expenses/src/funcs/expensesCreate.ts @@ -1,219 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create expense transaction - * - * @remarks - * The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. - * - * [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ -export function expensesCreate( - client: CodatSyncExpensesCore, - request: operations.CreateExpenseTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateExpenseTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateExpenseTransactionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/expense-transactions", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-expense-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["expenses"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateExpenseResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function expensesCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.expenses.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/expensesUpdate.ts b/sync-for-expenses/src/funcs/expensesUpdate.ts index a0fab447c..33aef62d7 100644 --- a/sync-for-expenses/src/funcs/expensesUpdate.ts +++ b/sync-for-expenses/src/funcs/expensesUpdate.ts @@ -1,231 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update expense transactions - * - * @remarks - * The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. - * - * [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. - * - * ### Supported integrations - * The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: - * | Integration | Supported | - * |-----------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - * - * #### Integration-specific behavior - * - * | Integration | Specifics | - * |-----------------------|-----------| - * | Sage Intacct | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.| - */ -export function expensesUpdate( - client: CodatSyncExpensesCore, - request: operations.UpdateExpenseTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.UpdateExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UpdateExpenseTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.UpdateExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UpdateExpenseTransactionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.UpdateExpenseRequest, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - transactionId: encodeSimple("transactionId", payload.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/expense-transactions/{transactionId}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-expense-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["expenses"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "422", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.UpdateExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(202, shared.UpdateExpenseResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 422, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function expensesUpdate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.expenses.update(request, options))); } diff --git a/sync-for-expenses/src/funcs/manageDataGet.ts b/sync-for-expenses/src/funcs/manageDataGet.ts index 4ca71189b..7da635044 100644 --- a/sync-for-expenses/src/funcs/manageDataGet.ts +++ b/sync-for-expenses/src/funcs/manageDataGet.ts @@ -1,185 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get data status - * - * @remarks - * Get the state of each data type for a company - */ -export function manageDataGet( - client: CodatSyncExpensesCore, - request: operations.GetDataStatusRequest, - options?: RequestOptions, -): APIPromise< - Result< - operations.GetDataStatusDataStatuses, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetDataStatusRequest, - options?: RequestOptions, -): Promise< - [ - Result< - operations.GetDataStatusDataStatuses, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetDataStatusRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/dataStatus")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-data-status", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["manageData"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - operations.GetDataStatusDataStatuses, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, operations.GetDataStatusDataStatuses$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function manageDataGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.manageData.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/manageDataGetPullOperation.ts b/sync-for-expenses/src/funcs/manageDataGetPullOperation.ts index cd593a2e6..00b82c8eb 100644 --- a/sync-for-expenses/src/funcs/manageDataGetPullOperation.ts +++ b/sync-for-expenses/src/funcs/manageDataGetPullOperation.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get pull operation - * - * @remarks - * Retrieve information about a single dataset or pull operation. - */ -export function manageDataGetPullOperation( - client: CodatSyncExpensesCore, - request: operations.GetPullOperationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetPullOperationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetPullOperationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - datasetId: encodeSimple("datasetId", payload.datasetId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/history/{datasetId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-pull-operation", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["manageData"]["getPullOperation"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperation$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function manageDataGetPullOperation( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.manageData.getPullOperation(request, options))); } diff --git a/sync-for-expenses/src/funcs/manageDataListPullOperations.ts b/sync-for-expenses/src/funcs/manageDataListPullOperations.ts index d0ab41b0f..4c64da2a4 100644 --- a/sync-for-expenses/src/funcs/manageDataListPullOperations.ts +++ b/sync-for-expenses/src/funcs/manageDataListPullOperations.ts @@ -1,208 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List pull operations - * - * @remarks - * Gets the pull operation history (datasets) for a given company. - */ -export function manageDataListPullOperations( - client: CodatSyncExpensesCore, - request: operations.ListPullOperationsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperations, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListPullOperationsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperations, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListPullOperationsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/history")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-pull-operations", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["manageData"]["listPullOperations"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperations, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperations$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function manageDataListPullOperations( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.manageData.listPullOperations(request, options))); } diff --git a/sync-for-expenses/src/funcs/manageDataRefreshAllDataTypes.ts b/sync-for-expenses/src/funcs/manageDataRefreshAllDataTypes.ts index 0d3d3b3a6..8a32b247d 100644 --- a/sync-for-expenses/src/funcs/manageDataRefreshAllDataTypes.ts +++ b/sync-for-expenses/src/funcs/manageDataRefreshAllDataTypes.ts @@ -1,205 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Refresh all data - * - * @remarks - * Refreshes all data types with `fetch on first link` set to `true` for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - * - * [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - */ -export function manageDataRefreshAllDataTypes( - client: CodatSyncExpensesCore, - request: operations.RefreshAllDataTypesRequest, - options?: RequestOptions, -): APIPromise< - Result< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.RefreshAllDataTypesRequest, - options?: RequestOptions, -): Promise< - [ - Result< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.RefreshAllDataTypesRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/all")(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "refresh-all-data-types", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["manageData"]["refreshAllDataTypes"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - void, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.nil(204, z.void()), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function manageDataRefreshAllDataTypes( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.manageData.refreshAllDataTypes(request, options))); } diff --git a/sync-for-expenses/src/funcs/manageDataRefreshDataType.ts b/sync-for-expenses/src/funcs/manageDataRefreshDataType.ts index 6e348a0af..025a11776 100644 --- a/sync-for-expenses/src/funcs/manageDataRefreshDataType.ts +++ b/sync-for-expenses/src/funcs/manageDataRefreshDataType.ts @@ -1,213 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Refresh data type - * - * @remarks - * Refreshes a given data type for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - */ -export function manageDataRefreshDataType( - client: CodatSyncExpensesCore, - request: operations.RefreshDataTypeRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.RefreshDataTypeRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PullOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.RefreshDataTypeRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - dataType: encodeSimple("dataType", payload.dataType, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/queue/{dataType}")( - pathParams, - ); - - const query = encodeFormQuery({ - "connectionId": payload.connectionId, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "refresh-data-type", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["manageData"]["refreshDataType"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PullOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PullOperation$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function manageDataRefreshDataType( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.manageData.refreshDataType(request, options))); } diff --git a/sync-for-expenses/src/funcs/mappingOptionsGetMappingOptions.ts b/sync-for-expenses/src/funcs/mappingOptionsGetMappingOptions.ts index ccce86b8c..a12b2d262 100644 --- a/sync-for-expenses/src/funcs/mappingOptionsGetMappingOptions.ts +++ b/sync-for-expenses/src/funcs/mappingOptionsGetMappingOptions.ts @@ -1,188 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Mapping options - * - * @remarks - * Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software - */ -export function mappingOptionsGetMappingOptions( - client: CodatSyncExpensesCore, - request: operations.GetMappingOptionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.MappingOptions, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetMappingOptionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.MappingOptions, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetMappingOptionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/mappingOptions", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-mapping-options", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["mappingOptions"]["getMappingOptions"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.MappingOptions, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.MappingOptions$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function mappingOptionsGetMappingOptions( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.mappingOptions.getMappingOptions(request, options))); } diff --git a/sync-for-expenses/src/funcs/pushOperationsGet.ts b/sync-for-expenses/src/funcs/pushOperationsGet.ts index 874b28987..f321604e2 100644 --- a/sync-for-expenses/src/funcs/pushOperationsGet.ts +++ b/sync-for-expenses/src/funcs/pushOperationsGet.ts @@ -1,193 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get push operation - * - * @remarks - * Retrieve push operation. - */ -export function pushOperationsGet( - client: CodatSyncExpensesCore, - request: operations.GetPushOperationRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetPushOperationRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetPushOperationRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - pushOperationKey: encodeSimple( - "pushOperationKey", - payload.pushOperationKey, - { explode: false, charEncoding: "percent" }, - ), - }; - const path = pathToFunc("/companies/{companyId}/push/{pushOperationKey}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-push-operation", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["pushOperations"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOperation, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOperation$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function pushOperationsGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.pushOperations.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/pushOperationsList.ts b/sync-for-expenses/src/funcs/pushOperationsList.ts index 8126236b6..c145f8573 100644 --- a/sync-for-expenses/src/funcs/pushOperationsList.ts +++ b/sync-for-expenses/src/funcs/pushOperationsList.ts @@ -1,208 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List push operations - * - * @remarks - * List push operation records. - */ -export function pushOperationsList( - client: CodatSyncExpensesCore, - request: operations.ListPushOperationsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.PushOperations, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListPushOperationsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.PushOperations, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListPushOperationsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/push")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-push-operations", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["pushOperations"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.PushOperations, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.PushOperations$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function pushOperationsList( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.pushOperations.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/reimbursementsCreate.ts b/sync-for-expenses/src/funcs/reimbursementsCreate.ts index 763b020f5..8abeea257 100644 --- a/sync-for-expenses/src/funcs/reimbursementsCreate.ts +++ b/sync-for-expenses/src/funcs/reimbursementsCreate.ts @@ -1,217 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create reimbursable expense transaction - * - * @remarks - * Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. - * - * [Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). - * - * ### Supported Integrations - * | Integration | Supported | - * |-----------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Zoho Books | Yes | - * | Sage Intacct | Yes | - */ -export function reimbursementsCreate( - client: CodatSyncExpensesCore, - request: operations.CreateReimbursableExpenseTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateReimbursableExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateReimbursableExpenseTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateReimbursableExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateReimbursableExpenseTransactionRequest$outboundSchema - .parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.RequestBody, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/reimbursable-expense-transactions", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-reimbursable-expense-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["reimbursements"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateReimbursableExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateReimbursableExpenseResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function reimbursementsCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.reimbursements.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/reimbursementsUpdate.ts b/sync-for-expenses/src/funcs/reimbursementsUpdate.ts index 7eae0e78e..3d4d40d2a 100644 --- a/sync-for-expenses/src/funcs/reimbursementsUpdate.ts +++ b/sync-for-expenses/src/funcs/reimbursementsUpdate.ts @@ -1,223 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update reimbursable expense transaction - * - * @remarks - * The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. - * - * Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). - * - * ### Supported Integrations - * | Integration | Supported | - * |-----------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Zoho Books | Yes | - */ -export function reimbursementsUpdate( - client: CodatSyncExpensesCore, - request: operations.UpdateReimbursableExpenseTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateReimbursableExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UpdateReimbursableExpenseTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateReimbursableExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.UpdateReimbursableExpenseTransactionRequest$outboundSchema - .parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON( - "body", - payload.UpdateReimbursableExpenseTransactionRequest, - { explode: true }, - ); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - transactionId: encodeSimple("transactionId", payload.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/reimbursable-expense-transactions/{transactionId}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-reimbursable-expense-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["reimbursements"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateReimbursableExpenseResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateReimbursableExpenseResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function reimbursementsUpdate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.reimbursements.update(request, options))); } diff --git a/sync-for-expenses/src/funcs/suppliersCreate.ts b/sync-for-expenses/src/funcs/suppliersCreate.ts index d77d50ec1..c4ddc51f8 100644 --- a/sync-for-expenses/src/funcs/suppliersCreate.ts +++ b/sync-for-expenses/src/funcs/suppliersCreate.ts @@ -1,232 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create supplier - * - * @remarks - * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | Oracle NetSuite | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ -export function suppliersCreate( - client: CodatSyncExpensesCore, - request: operations.CreateSupplierRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CreateSupplierResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateSupplierRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CreateSupplierResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.CreateSupplierRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.Supplier, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/suppliers", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-supplier", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["suppliers"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "POST", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CreateSupplierResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CreateSupplierResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/suppliersGet.ts b/sync-for-expenses/src/funcs/suppliersGet.ts index 36b31c8fe..076a6cb71 100644 --- a/sync-for-expenses/src/funcs/suppliersGet.ts +++ b/sync-for-expenses/src/funcs/suppliersGet.ts @@ -1,223 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get supplier - * - * @remarks - * The *Get supplier* endpoint returns a single supplier for a given supplierId. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | Oracle NetSuite | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ -export function suppliersGet( - client: CodatSyncExpensesCore, - request: operations.GetSupplierRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetSupplierRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetSupplierRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - supplierId: encodeSimple("supplierId", payload.supplierId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/suppliers/{supplierId}")( - pathParams, - ); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-supplier", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["suppliers"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Supplier, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Supplier$inboundSchema), - M.jsonErr( - [401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/suppliersList.ts b/sync-for-expenses/src/funcs/suppliersList.ts index 5840cba71..24dd149ad 100644 --- a/sync-for-expenses/src/funcs/suppliersList.ts +++ b/sync-for-expenses/src/funcs/suppliersList.ts @@ -1,226 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List suppliers - * - * @remarks - * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | Oracle NetSuite | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ -export function suppliersList( - client: CodatSyncExpensesCore, - request: operations.ListSuppliersRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Suppliers, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListSuppliersRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Suppliers, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListSuppliersRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc("/companies/{companyId}/data/suppliers")(pathParams); - - const query = encodeFormQuery({ - "orderBy": payload.orderBy, - "page": payload.page, - "pageSize": payload.pageSize, - "query": payload.query, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-suppliers", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["suppliers"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "409", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Suppliers, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Suppliers$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 409, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersList( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/suppliersUpdate.ts b/sync-for-expenses/src/funcs/suppliersUpdate.ts index 90eb5ecc0..453d0b89f 100644 --- a/sync-for-expenses/src/funcs/suppliersUpdate.ts +++ b/sync-for-expenses/src/funcs/suppliersUpdate.ts @@ -1,232 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Update supplier - * - * @remarks - * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - */ -export function suppliersUpdate( - client: CodatSyncExpensesCore, - request: operations.UpdateSupplierRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.UpdateSupplierResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.UpdateSupplierRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.UpdateSupplierResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.UpdateSupplierRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.Supplier, { explode: true }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - connectionId: encodeSimple("connectionId", payload.connectionId, { - explode: false, - charEncoding: "percent", - }), - supplierId: encodeSimple("supplierId", payload.supplierId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}", - )(pathParams); - - const query = encodeFormQuery({ - "allowSyncOnPushComplete": payload.allowSyncOnPushComplete, - "forceUpdate": payload.forceUpdate, - "timeoutInMinutes": payload.timeoutInMinutes, - }); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "update-supplier", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["suppliers"]["update"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.UpdateSupplierResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.UpdateSupplierResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function suppliersUpdate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.suppliers.update(request, options))); } diff --git a/sync-for-expenses/src/funcs/syncGet.ts b/sync-for-expenses/src/funcs/syncGet.ts index 027117180..497e18064 100644 --- a/sync-for-expenses/src/funcs/syncGet.ts +++ b/sync-for-expenses/src/funcs/syncGet.ts @@ -1,192 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get sync status - * - * @remarks - * Get the sync status for a specified sync - */ -export function syncGet( - client: CodatSyncExpensesCore, - request: operations.GetSyncByIdRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetSyncByIdRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetSyncByIdRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - syncId: encodeSimple("syncId", payload.syncId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/{syncId}/status", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-sync-by-id", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["sync"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanySyncStatus$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function syncGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sync.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/syncGetLastSuccessfulSync.ts b/sync-for-expenses/src/funcs/syncGetLastSuccessfulSync.ts index 4c5fb7e48..bad3c49cb 100644 --- a/sync-for-expenses/src/funcs/syncGetLastSuccessfulSync.ts +++ b/sync-for-expenses/src/funcs/syncGetLastSuccessfulSync.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Last successful sync - * - * @remarks - * Gets the status of the last successful sync - */ -export function syncGetLastSuccessfulSync( - client: CodatSyncExpensesCore, - request: operations.GetLastSuccessfulSyncRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetLastSuccessfulSyncRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.GetLastSuccessfulSyncRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/lastSuccessful/status", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-last-successful-sync", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["sync"]["getLastSuccessfulSync"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanySyncStatus$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function syncGetLastSuccessfulSync( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sync.getLastSuccessfulSync(request, options))); } diff --git a/sync-for-expenses/src/funcs/syncGetLatestSync.ts b/sync-for-expenses/src/funcs/syncGetLatestSync.ts index 4bf2be91a..6f2322443 100644 --- a/sync-for-expenses/src/funcs/syncGetLatestSync.ts +++ b/sync-for-expenses/src/funcs/syncGetLatestSync.ts @@ -1,188 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Latest sync status - * - * @remarks - * Gets the latest sync status - */ -export function syncGetLatestSync( - client: CodatSyncExpensesCore, - request: operations.GetLatestSyncRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetLatestSyncRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetLatestSyncRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/latest/status", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-latest-sync", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["sync"]["getLatestSync"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.CompanySyncStatus, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.CompanySyncStatus$inboundSchema), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function syncGetLatestSync( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sync.getLatestSync(request, options))); } diff --git a/sync-for-expenses/src/funcs/syncList.ts b/sync-for-expenses/src/funcs/syncList.ts index 4e99ce851..d0a5776bb 100644 --- a/sync-for-expenses/src/funcs/syncList.ts +++ b/sync-for-expenses/src/funcs/syncList.ts @@ -1,189 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List sync statuses - * - * @remarks - * Gets a list of sync statuses - */ -export function syncList( - client: CodatSyncExpensesCore, - request: operations.ListSyncsRequest, - options?: RequestOptions, -): APIPromise< - Result< - Array, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListSyncsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - Array, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.ListSyncsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/list/status", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-syncs", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["sync"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - Array, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, z.array(shared.CompanySyncStatus$inboundSchema)), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function syncList( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.sync.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/transactionStatusGet.ts b/sync-for-expenses/src/funcs/transactionStatusGet.ts index 49f575efb..b339ced23 100644 --- a/sync-for-expenses/src/funcs/transactionStatusGet.ts +++ b/sync-for-expenses/src/funcs/transactionStatusGet.ts @@ -1,197 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Get sync transaction - * - * @remarks - * Gets the status of a transaction for a sync - */ -export function transactionStatusGet( - client: CodatSyncExpensesCore, - request: operations.GetSyncTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - Array, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.GetSyncTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - Array, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => operations.GetSyncTransactionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - syncId: encodeSimple("syncId", payload.syncId, { - explode: false, - charEncoding: "percent", - }), - transactionId: encodeSimple("transactionId", payload.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions/{transactionId}", - )(pathParams); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "get-sync-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["transactionStatus"]["get"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: ["401", "402", "403", "404", "429", "4XX", "500", "503", "5XX"], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - Array, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, z.array(shared.Transaction$inboundSchema)), - M.jsonErr([401, 402, 403, 404, 429], errors.ErrorMessage$inboundSchema), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transactionStatusGet( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transactionStatus.get(request, options))); } diff --git a/sync-for-expenses/src/funcs/transactionStatusList.ts b/sync-for-expenses/src/funcs/transactionStatusList.ts index 4af73ee5d..7c4f94943 100644 --- a/sync-for-expenses/src/funcs/transactionStatusList.ts +++ b/sync-for-expenses/src/funcs/transactionStatusList.ts @@ -1,213 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeFormQuery, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * List sync transactions - * - * @remarks - * Gets the transactions and status for a sync - */ -export function transactionStatusList( - client: CodatSyncExpensesCore, - request: operations.ListSyncTransactionsRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.Transactions, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.ListSyncTransactionsRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.Transactions, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.ListSyncTransactionsRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = null; - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - syncId: encodeSimple("syncId", payload.syncId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/syncs/{syncId}/transactions", - )(pathParams); - - const query = encodeFormQuery({ - "page": payload.page, - "pageSize": payload.pageSize, - }); - - const headers = new Headers(compactMap({ - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "list-sync-transactions", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["transactionStatus"]["list"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "GET", - baseURL: options?.serverURL, - path: path, - headers: headers, - query: query, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.Transactions, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.Transactions$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transactionStatusList( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transactionStatus.list(request, options))); } diff --git a/sync-for-expenses/src/funcs/transfersCreate.ts b/sync-for-expenses/src/funcs/transfersCreate.ts index 5bd70d067..b57deb537 100644 --- a/sync-for-expenses/src/funcs/transfersCreate.ts +++ b/sync-for-expenses/src/funcs/transfersCreate.ts @@ -1,226 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesCore } from "../core.js"; -import { encodeJSON, encodeSimple } from "../lib/encodings.js"; -import * as M from "../lib/matchers.js"; -import { compactMap } from "../lib/primitives.js"; -import { safeParse } from "../lib/schemas.js"; -import { RequestOptions } from "../lib/sdks.js"; -import { extractSecurity, resolveGlobalSecurity } from "../lib/security.js"; -import { pathToFunc } from "../lib/url.js"; -import { CodatSyncExpensesError } from "../sdk/models/errors/codatsyncexpenseserror.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import * as errors from "../sdk/models/errors/index.js"; -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as operations from "../sdk/models/operations/index.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { APICall, APIPromise } from "../sdk/types/async.js"; -import { Result } from "../sdk/types/fp.js"; +import type { CodatSyncExpenses, CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import type { Result } from "../sdk/types/fp"; +import { toResult } from "./_adapter"; -/** - * Create transfer transaction - * - * @remarks - * Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. - * - * Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. - * - * The `from.amount` and `to.amount` fields are in the native currency of the account. - * - * ### Supported Integrations - * | Integration | Create transfer | Update transfer | - * |-----------------------|------------------|------------------| - * | Dynamics | No | No | - * | FreeAgent | Yes | Yes | - * | NetSuite | No | No | - * | QuickBooks Desktop | Yes | No | - * | QuickBooks Online | Yes | Yes | - * | Sage Intacct | No | No | - * | Xero | Yes | No | - * | Zoho Books | No | No | - */ -export function transfersCreate( - client: CodatSyncExpensesCore, - request: operations.CreateTransferTransactionRequest, - options?: RequestOptions, -): APIPromise< - Result< - shared.TransferTransactionResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - > -> { - return new APIPromise($do( - client, - request, - options, - )); -} - -async function $do( - client: CodatSyncExpensesCore, - request: operations.CreateTransferTransactionRequest, - options?: RequestOptions, -): Promise< - [ - Result< - shared.TransferTransactionResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >, - APICall, - ] -> { - const parsed = safeParse( - request, - (value) => - operations.CreateTransferTransactionRequest$outboundSchema.parse(value), - "Input validation failed", - ); - if (!parsed.ok) { - return [parsed, { status: "invalid" }]; - } - const payload = parsed.value; - const body = encodeJSON("body", payload.TransferTransactionRequest, { - explode: true, - }); - - const pathParams = { - companyId: encodeSimple("companyId", payload.companyId, { - explode: false, - charEncoding: "percent", - }), - transactionId: encodeSimple("transactionId", payload.transactionId, { - explode: false, - charEncoding: "percent", - }), - }; - const path = pathToFunc( - "/companies/{companyId}/sync/expenses/transfer-transactions/{transactionId}", - )(pathParams); - - const headers = new Headers(compactMap({ - "Content-Type": "application/json", - Accept: "application/json", - })); - - const secConfig = await extractSecurity(client._options.authHeader); - const securityInput = secConfig == null ? {} : { authHeader: secConfig }; - const requestSecurity = resolveGlobalSecurity(securityInput); - - const context = { - options: client._options, - baseURL: options?.serverURL ?? client._baseURL ?? "", - operationID: "create-transfer-transaction", - oAuth2Scopes: null, +type Call = CodatSyncExpenses["transfers"]["create"]; - resolvedSecurity: requestSecurity, - - securitySource: client._options.authHeader, - retryConfig: options?.retries - || client._options.retryConfig - || { - strategy: "backoff", - backoff: { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, - }, - retryConnectionErrors: true, - } - || { strategy: "none" }, - retryCodes: options?.retryCodes || ["408", "429", "5XX"], - }; - - const requestRes = client._createRequest(context, { - security: requestSecurity, - method: "PUT", - baseURL: options?.serverURL, - path: path, - headers: headers, - body: body, - userAgent: client._options.userAgent, - timeoutMs: options?.timeoutMs || client._options.timeoutMs || -1, - }, options); - if (!requestRes.ok) { - return [requestRes, { status: "invalid" }]; - } - const req = requestRes.value; - - const doResult = await client._do(req, { - context, - errorCodes: [ - "400", - "401", - "402", - "403", - "404", - "429", - "4XX", - "500", - "503", - "5XX", - ], - retryConfig: context.retryConfig, - retryCodes: context.retryCodes, - }); - if (!doResult.ok) { - return [doResult, { status: "request-error", request: req }]; - } - const response = doResult.value; - - const responseFields = { - HttpMeta: { Response: response, Request: req }, - }; - - const [result] = await M.match< - shared.TransferTransactionResponse, - | errors.ErrorMessage - | CodatSyncExpensesError - | ResponseValidationError - | ConnectionError - | RequestAbortedError - | RequestTimeoutError - | InvalidRequestError - | UnexpectedClientError - | SDKValidationError - >( - M.json(200, shared.TransferTransactionResponse$inboundSchema), - M.jsonErr( - [400, 401, 402, 403, 404, 429], - errors.ErrorMessage$inboundSchema, - ), - M.jsonErr([500, 503], errors.ErrorMessage$inboundSchema), - M.fail("4XX"), - M.fail("5XX"), - )(response, req, { extraFields: responseFields }); - if (!result.ok) { - return [result, { status: "complete", request: req, response }]; - } - - return [result, { status: "complete", request: req, response }]; +export function transfersCreate( + client: CodatSyncExpensesCore, + request: Parameters[0], + options?: Parameters[1], +): APIPromise>, Error>> { + return new APIPromise(toResult(() => client.transfers.create(request, options))); } diff --git a/sync-for-expenses/src/funcs/validateWebhook.ts b/sync-for-expenses/src/funcs/validateWebhook.ts index 77bac9aaf..86cfaa313 100644 --- a/sync-for-expenses/src/funcs/validateWebhook.ts +++ b/sync-for-expenses/src/funcs/validateWebhook.ts @@ -1,63 +1,73 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { CodatSyncExpensesCore } from "../core.js"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import * as shared from "../sdk/models/shared/index.js"; -import { ERR, Result } from "../sdk/types/fp.js"; - -export async function validateWebhook(_client: CodatSyncExpensesCore, { - request: rawRequest, -}: { - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request; -}): Promise< - Result< - shared.ExpensesSyncWebhook | undefined | shared.ClientRateLimitWebhook, - SDKValidationError - > -> { - const request = normalizeRequest(rawRequest); - const knownSchemas = [ - shared.expensesSyncWebhookFromJSON, - shared.expensesSyncWebhookFromJSON, - shared.clientRateLimitWebhookFromJSON, - shared.clientRateLimitWebhookFromJSON, - ]; - - const jsonString = await request.text(); - - for (const schema of knownSchemas) { - const ret = schema(jsonString); - if (ret.ok) { - return ret; +/* tslint:disable */ +/* eslint-disable */ + +import type { CodatSyncExpensesCore } from "../core"; +import { APIPromise } from "../sdk/types/async"; +import { OK, ERR } from "../sdk/types/fp"; +import type { Result } from "../sdk/types/fp"; +import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror"; +import type * as shared from "../sdk/models/index"; + +type ValidateWebhookResult = shared.ExpensesSyncWebhook | shared.ClientRateLimitWebhook | undefined; + +type WebhookMatchSpec = + | "string" + | "number" + | "boolean" + | "any" + | { kind: "nullable"; inner: WebhookMatchSpec } + | { kind: "array"; items: WebhookMatchSpec } + | { kind: "object"; required: string[]; props: Record }; + +function conformsToWebhookSpec(value: unknown, spec: WebhookMatchSpec): boolean { + if (spec === "any") { return true; } + if (spec === "string") { return typeof value === "string"; } + if (spec === "number") { return typeof value === "number"; } + if (spec === "boolean") { return typeof value === "boolean"; } + if (spec.kind === "nullable") { return value === null || conformsToWebhookSpec(value, spec.inner); } + if (spec.kind === "array") { return Array.isArray(value) && value.every((item) => conformsToWebhookSpec(item, spec.items)); } + if (value === null || typeof value !== "object" || Array.isArray(value)) { return false; } + const object = value as Record; + for (const key of spec.required) { + if (object[key] === undefined) { return false; } + } + for (const key of Object.keys(spec.props)) { + if (object[key] === undefined) { continue; } + if (!conformsToWebhookSpec(object[key], spec.props[key])) { return false; } } - } - - return ERR( - new SDKValidationError( - "No matching schema found for the given webhook payload", - jsonString, - jsonString, - ), - ); + return true; } -function normalizeRequest( - request: { - body: BodyInit; - method: string; - url: string; - headers: Record | Headers; - } | Request, +function normalizeWebhookRequest( + request: { body: string; method: string; url: string; headers: Record | Headers } | Request, ): Request { - if (request instanceof Request) { - return request; - } - return new Request(request.url, request); + if (typeof Request !== "undefined" && request instanceof Request) { return request; } + return new Request(request.url, request); +} + +const WEBHOOK_NO_MATCH_MESSAGE = "No matching schema found for the given webhook payload"; + +const WEBHOOK_MATCH_ORDER: { name: string; spec: WebhookMatchSpec }[] = [ + { name: "ExpensesSyncWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"referenceCompany": {"kind": "object", "required": [], "props": {"id": "string", "name": "string", "description": "string", "links": {"kind": "object", "required": [], "props": {"portal": "string"}}, "tags": {"kind": "object", "required": [], "props": {}}}}, "syncId": "string", "transactions": {"kind": "array", "items": {"kind": "object", "required": [], "props": {"id": "string", "status": "string", "errorMessage": {"kind": "nullable", "inner": "string"}}}}}}}} }, + { name: "ClientRateLimitWebhook", spec: {"kind": "object", "required": [], "props": {"id": "string", "eventType": "string", "generatedDate": "string", "payload": {"kind": "object", "required": [], "props": {"dailyQuota": "number", "quotaRemaining": "number", "expiryDate": "string"}}}} } +]; + +export function validateWebhook(_client: CodatSyncExpensesCore, { request }: { request: { body: string; method: string; url: string; headers: Record | Headers } | Request }): APIPromise> { + void _client; + return new APIPromise((async (): Promise> => { + const normalized = normalizeWebhookRequest(request); + const jsonString = await normalized.text(); + let parsed: unknown; + try { + parsed = JSON.parse(jsonString); + } catch { + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + } + for (const member of WEBHOOK_MATCH_ORDER) { + if (conformsToWebhookSpec(parsed, member.spec)) { + return OK(parsed as ValidateWebhookResult); + } + } + return ERR(new SDKValidationError(WEBHOOK_NO_MATCH_MESSAGE, jsonString, jsonString)); + })()); } diff --git a/sync-for-expenses/src/hooks/hooks.ts b/sync-for-expenses/src/hooks/hooks.ts index d34c88497..b628a2bf8 100644 --- a/sync-for-expenses/src/hooks/hooks.ts +++ b/sync-for-expenses/src/hooks/hooks.ts @@ -1,132 +1,75 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { RequestInput } from "../lib/http.js"; import { - AfterErrorContext, - AfterErrorHook, - AfterSuccessContext, - AfterSuccessHook, - BeforeCreateRequestContext, - BeforeCreateRequestHook, - BeforeRequestContext, - BeforeRequestHook, - Hook, - Hooks, - SDKInitHook, - SDKInitOptions, -} from "./types.js"; - -import { initHooks } from "./registration.js"; + AfterErrorContext, AfterErrorHook, AfterSuccessContext, AfterSuccessHook, + BeforeCreateRequestContext, BeforeCreateRequestHook, BeforeRequestContext, BeforeRequestHook, + Hook, Hooks, SDKInitHook, SDKInitOptions, +} from "./types"; +import { RequestInput } from "../lib/sdkconfig"; +import { initHooks } from "./registration"; export class SDKHooks implements Hooks { - sdkInitHooks: SDKInitHook[] = []; - beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; - beforeRequestHooks: BeforeRequestHook[] = []; - afterSuccessHooks: AfterSuccessHook[] = []; - afterErrorHooks: AfterErrorHook[] = []; - - constructor() { - const presetHooks: Array = []; - - for (const hook of presetHooks) { - if ("sdkInit" in hook) { - this.registerSDKInitHook(hook); - } - if ("beforeCreateRequest" in hook) { - this.registerBeforeCreateRequestHook(hook); - } - if ("beforeRequest" in hook) { - this.registerBeforeRequestHook(hook); - } - if ("afterSuccess" in hook) { - this.registerAfterSuccessHook(hook); - } - if ("afterError" in hook) { - this.registerAfterErrorHook(hook); - } + sdkInitHooks: SDKInitHook[] = []; + beforeCreateRequestHooks: BeforeCreateRequestHook[] = []; + beforeRequestHooks: BeforeRequestHook[] = []; + afterSuccessHooks: AfterSuccessHook[] = []; + afterErrorHooks: AfterErrorHook[] = []; + + constructor() { + const presetHooks: Array = []; + for (const hook of presetHooks) { + if ("sdkInit" in hook) { this.registerSDKInitHook(hook); } + if ("beforeCreateRequest" in hook) { this.registerBeforeCreateRequestHook(hook); } + if ("beforeRequest" in hook) { this.registerBeforeRequestHook(hook); } + if ("afterSuccess" in hook) { this.registerAfterSuccessHook(hook); } + if ("afterError" in hook) { this.registerAfterErrorHook(hook); } + } + initHooks(this); } - initHooks(this); - } - - registerSDKInitHook(hook: SDKInitHook) { - this.sdkInitHooks.push(hook); - } - - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { - this.beforeCreateRequestHooks.push(hook); - } - - registerBeforeRequestHook(hook: BeforeRequestHook) { - this.beforeRequestHooks.push(hook); - } - - registerAfterSuccessHook(hook: AfterSuccessHook) { - this.afterSuccessHooks.push(hook); - } - - registerAfterErrorHook(hook: AfterErrorHook) { - this.afterErrorHooks.push(hook); - } - sdkInit(opts: SDKInitOptions): SDKInitOptions { - return this.sdkInitHooks.reduce((opts, hook) => hook.sdkInit(opts), opts); - } + registerSDKInitHook(hook: SDKInitHook) { this.sdkInitHooks.push(hook); } + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook) { this.beforeCreateRequestHooks.push(hook); } + registerBeforeRequestHook(hook: BeforeRequestHook) { this.beforeRequestHooks.push(hook); } + registerAfterSuccessHook(hook: AfterSuccessHook) { this.afterSuccessHooks.push(hook); } + registerAfterErrorHook(hook: AfterErrorHook) { this.afterErrorHooks.push(hook); } - beforeCreateRequest( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ): RequestInput { - let inp = input; - - for (const hook of this.beforeCreateRequestHooks) { - inp = hook.beforeCreateRequest(hookCtx, inp); + sdkInit(opts: SDKInitOptions): SDKInitOptions { + return this.sdkInitHooks.reduce((o, hook) => hook.sdkInit(o), opts); } - return inp; - } - - async beforeRequest( - hookCtx: BeforeRequestContext, - request: Request, - ): Promise { - let req = request; - - for (const hook of this.beforeRequestHooks) { - req = await hook.beforeRequest(hookCtx, req); + beforeCreateRequest(hookCtx: BeforeCreateRequestContext, input: RequestInput): RequestInput { + let inp = input; + for (const hook of this.beforeCreateRequestHooks) { + inp = hook.beforeCreateRequest(hookCtx, inp); + } + return inp; } - return req; - } - - async afterSuccess( - hookCtx: AfterSuccessContext, - response: Response, - ): Promise { - let res = response; - - for (const hook of this.afterSuccessHooks) { - res = await hook.afterSuccess(hookCtx, res); + async beforeRequest(hookCtx: BeforeRequestContext, request: Request): Promise { + let req = request; + for (const hook of this.beforeRequestHooks) { + req = await hook.beforeRequest(hookCtx, req); + } + return req; } - return res; - } - - async afterError( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ): Promise<{ response: Response | null; error: unknown }> { - let res = response; - let err = error; - - for (const hook of this.afterErrorHooks) { - const result = await hook.afterError(hookCtx, res, err); - res = result.response; - err = result.error; + async afterSuccess(hookCtx: AfterSuccessContext, response: Response): Promise { + let res = response; + for (const hook of this.afterSuccessHooks) { + res = await hook.afterSuccess(hookCtx, res); + } + return res; } - return { response: res, error: err }; - } + async afterError(hookCtx: AfterErrorContext, response: Response | null, error: unknown): Promise<{ response: Response | null; error: unknown }> { + let res = response; + let err = error; + for (const hook of this.afterErrorHooks) { + const result = await hook.afterError(hookCtx, res, err); + res = result.response; + err = result.error; + } + return { response: res, error: err }; + } } diff --git a/sync-for-expenses/src/hooks/index.ts b/sync-for-expenses/src/hooks/index.ts index f60ec7acd..ae868065a 100644 --- a/sync-for-expenses/src/hooks/index.ts +++ b/sync-for-expenses/src/hooks/index.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./hooks.js"; -export * from "./types.js"; +export * from "./hooks"; +export * from "./types"; diff --git a/sync-for-expenses/src/hooks/types.ts b/sync-for-expenses/src/hooks/types.ts index 494395f66..3818216a1 100644 --- a/sync-for-expenses/src/hooks/types.ts +++ b/sync-for-expenses/src/hooks/types.ts @@ -1,29 +1,23 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { SDKOptions } from "../lib/config.js"; -import { HTTPClient, RequestInput } from "../lib/http.js"; -import { RetryConfig } from "../lib/retries.js"; -import { SecurityState } from "../lib/security.js"; -import { WebhookRecipient } from "../sdk/types/webhooks.js"; +import { SDKOptions, RetryConfig, HTTPClient, RequestInput, SecurityState } from "../lib/sdkconfig"; + +export type Awaitable = T | Promise; export type HookContext = { - baseURL: string | URL; - operationID: string; - oAuth2Scopes: string[] | null; - webhookRecipient?: WebhookRecipient; - securitySource?: any | (() => Promise); - retryConfig: RetryConfig; - resolvedSecurity: SecurityState | null; - options: SDKOptions; + baseURL: string | URL; + operationID: string; + oAuth2Scopes: string[] | null; + securitySource?: unknown | (() => Promise); + retryConfig: RetryConfig; + resolvedSecurity: SecurityState | null; + options: SDKOptions; }; -export type Awaitable = T | Promise; - export type SDKInitOptions = { - baseURL: URL | null; - client: HTTPClient; + baseURL: URL | null; + client: HTTPClient; }; export type BeforeCreateRequestContext = HookContext & {}; @@ -31,84 +25,37 @@ export type BeforeRequestContext = HookContext & {}; export type AfterSuccessContext = HookContext & {}; export type AfterErrorContext = HookContext & {}; -/** - * SDKInitHook is called when the SDK is initializing. The - * hook can return a new baseURL and HTTP client to be used by the SDK. - */ export interface SDKInitHook { - sdkInit: (opts: SDKInitOptions) => SDKInitOptions; + sdkInit: (opts: SDKInitOptions) => SDKInitOptions; } export interface BeforeCreateRequestHook { - /** - * A hook that is called before the SDK creates a `Request` object. The hook - * can modify how a request is constructed since certain modifications, like - * changing the request URL, cannot be done on a request object directly. - */ - beforeCreateRequest: ( - hookCtx: BeforeCreateRequestContext, - input: RequestInput, - ) => RequestInput; + beforeCreateRequest: (hookCtx: BeforeCreateRequestContext, input: RequestInput) => RequestInput; } export interface BeforeRequestHook { - /** - * A hook that is called before the SDK sends a request. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * replace the request before it is sent or throw an error to stop the - * request from being sent. - */ - beforeRequest: ( - hookCtx: BeforeRequestContext, - request: Request, - ) => Awaitable; + beforeRequest: (hookCtx: BeforeRequestContext, request: Request) => Awaitable; } export interface AfterSuccessHook { - /** - * A hook that is called after the SDK receives a response. The hook can - * introduce instrumentation code such as logging, tracing and metrics or - * modify the response before it is handled or throw an error to stop the - * response from being handled. - */ - afterSuccess: ( - hookCtx: AfterSuccessContext, - response: Response, - ) => Awaitable; + afterSuccess: (hookCtx: AfterSuccessContext, response: Response) => Awaitable; } export interface AfterErrorHook { - /** - * A hook that is called after the SDK encounters an error, or a - * non-successful response. The hook can introduce instrumentation code such - * as logging, tracing and metrics or modify the response or error values. - */ - afterError: ( - hookCtx: AfterErrorContext, - response: Response | null, - error: unknown, - ) => Awaitable<{ - response: Response | null; - error: unknown; - }>; + afterError: (hookCtx: AfterErrorContext, response: Response | null, error: unknown) => Awaitable<{ response: Response | null; error: unknown }>; } export interface Hooks { - /** Registers a hook to be used by the SDK for initialization event. */ - registerSDKInitHook(hook: SDKInitHook): void; - /** Registers a hook to be used by the SDK for to modify `Request` construction. */ - registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; - /** Registers a hook to be used by the SDK for the before request event. */ - registerBeforeRequestHook(hook: BeforeRequestHook): void; - /** Registers a hook to be used by the SDK for the after success event. */ - registerAfterSuccessHook(hook: AfterSuccessHook): void; - /** Registers a hook to be used by the SDK for the after error event. */ - registerAfterErrorHook(hook: AfterErrorHook): void; + registerSDKInitHook(hook: SDKInitHook): void; + registerBeforeCreateRequestHook(hook: BeforeCreateRequestHook): void; + registerBeforeRequestHook(hook: BeforeRequestHook): void; + registerAfterSuccessHook(hook: AfterSuccessHook): void; + registerAfterErrorHook(hook: AfterErrorHook): void; } export type Hook = - | SDKInitHook - | BeforeCreateRequestHook - | BeforeRequestHook - | AfterSuccessHook - | AfterErrorHook; + | SDKInitHook + | BeforeCreateRequestHook + | BeforeRequestHook + | AfterSuccessHook + | AfterErrorHook; diff --git a/sync-for-expenses/src/index.ts b/sync-for-expenses/src/index.ts index dbcba164a..52b74ba06 100644 --- a/sync-for-expenses/src/index.ts +++ b/sync-for-expenses/src/index.ts @@ -1,9 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./lib/config.js"; -export * as files from "./lib/files.js"; -export { HTTPClient } from "./lib/http.js"; -export type { Fetcher, HTTPClientOptions } from "./lib/http.js"; -export * from "./sdk/sdk.js"; +/* tslint:disable */ +/* eslint-disable */ +export * from './runtime'; +export * from './sdk/models/index'; +export * from './sdk/types/rfcdate'; +export * from './sdk'; +export * from './lib/sdkconfig'; diff --git a/sync-for-expenses/src/lib/base64.ts b/sync-for-expenses/src/lib/base64.ts deleted file mode 100644 index 0aebd8b0a..000000000 --- a/sync-for-expenses/src/lib/base64.ts +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function bytesToBase64(u8arr: Uint8Array): string { - return btoa(String.fromCodePoint(...u8arr)); -} - -export function bytesFromBase64(encoded: string): Uint8Array { - return Uint8Array.from(atob(encoded), (c) => c.charCodeAt(0)); -} - -export function stringToBytes(str: string): Uint8Array { - return new TextEncoder().encode(str); -} - -export function stringFromBytes(u8arr: Uint8Array): string { - return new TextDecoder().decode(u8arr); -} - -export function stringToBase64(str: string): string { - return bytesToBase64(stringToBytes(str)); -} - -export function stringFromBase64(b64str: string): string { - return stringFromBytes(bytesFromBase64(b64str)); -} - -export const zodOutbound = z - .instanceof(Uint8Array) - .or(z.string().transform(stringToBytes)); - -export const zodInbound = z - .instanceof(Uint8Array) - .or(z.string().transform(bytesFromBase64)); diff --git a/sync-for-expenses/src/lib/config.ts b/sync-for-expenses/src/lib/config.ts index 450c22c01..416844419 100644 --- a/sync-for-expenses/src/lib/config.ts +++ b/sync-for-expenses/src/lib/config.ts @@ -1,65 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { HTTPClient } from "./http.js"; -import { Logger } from "./logger.js"; -import { RetryConfig } from "./retries.js"; -import { Params, pathToFunc } from "./url.js"; - -/** - * Contains the list of servers available to the SDK - */ -export const ServerList = [ - "https://api.codat.io", -] as const; - -export type SDKOptions = { - authHeader?: string | (() => Promise) | undefined; - - httpClient?: HTTPClient; - /** - * Allows overriding the default server used by the SDK - */ - serverIdx?: number | undefined; - /** - * Allows overriding the default server URL used by the SDK - */ - serverURL?: string | undefined; - /** - * Allows overriding the default user agent used by the SDK - */ - userAgent?: string | undefined; - /** - * Allows overriding the default retry config used by the SDK - */ - retryConfig?: RetryConfig; - timeoutMs?: number; - debugLogger?: Logger; -}; - -export function serverURLFromOptions(options: SDKOptions): URL | null { - let serverURL = options.serverURL; - - const params: Params = {}; - - if (!serverURL) { - const serverIdx = options.serverIdx ?? 0; - if (serverIdx < 0 || serverIdx >= ServerList.length) { - throw new Error(`Invalid server index ${serverIdx}`); - } - serverURL = ServerList[serverIdx] || ""; - } - - const u = pathToFunc(serverURL)(params); - return new URL(u); +export function serverURLFromOptions(options: unknown): string { + void options; + return ""; } - -export const SDK_METADATA = { - language: "typescript", - openapiDocVersion: "prealpha", - sdkVersion: "7.1.1", - genVersion: "2.879.13", - userAgent: - "speakeasy-sdk/typescript 7.1.1 2.879.13 prealpha @codat/sync-for-expenses", -} as const; diff --git a/sync-for-expenses/src/lib/dlv.ts b/sync-for-expenses/src/lib/dlv.ts deleted file mode 100644 index e81091f5e..000000000 --- a/sync-for-expenses/src/lib/dlv.ts +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) 2024 Jason Miller (http://jasonformat.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -/** - * @param obj The object to walk - * @param key The key path to walk the object with - * @param def A default value to return if the result is undefined - * - * @example - * dlv(obj, "a.b.c.d") - * @example - * dlv(object, ["a", "b", "c", "d"]) - * @example - * dlv(object, "foo.bar.baz", "Hello, default value!") - */ -export function dlv( - obj: any, - key: string | string[], - def?: T, - p?: number, - undef?: never, -): T | undefined { - key = Array.isArray(key) ? key : key.split("."); - for (p = 0; p < key.length; p++) { - const k = key[p]; - obj = k != null && obj ? obj[k] : undef; - } - return obj === undef ? def : obj; -} diff --git a/sync-for-expenses/src/lib/encodings.ts b/sync-for-expenses/src/lib/encodings.ts deleted file mode 100644 index 2791d25bc..000000000 --- a/sync-for-expenses/src/lib/encodings.ts +++ /dev/null @@ -1,525 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bytesToBase64 } from "./base64.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export class EncodingError extends Error { - constructor(message: string) { - super(message); - this.name = "EncodingError"; - } -} - -export function encodeMatrix( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - const keyPrefix = encodeString(pk); - tmp = `${keyPrefix}=${encValue}`; - // trim trailing '=' if value was empty - if (tmp === `${keyPrefix}=`) { - tmp = tmp.slice(0, -1); - } - - // If we end up with the nothing then skip forward - if (!tmp) { - return; - } - - out += `;${tmp}`; - }); - - return out; -} - -export function encodeLabel( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let encValue: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join("."); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `.${encodeString(k)}.${encodeValue(v)}`; - }); - encValue = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) - ? `${encodeString(pk)}=` - : ""; - encValue = `${k}${encodeValue(pv)}`; - } - - out += encValue == null ? "" : `.${encValue}`; - }); - - return out; -} - -type FormEncoder = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -) => string | undefined; - -function formEncoder(sep: string): FormEncoder { - return ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, - ) => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - const encodedSep = encodeString(sep); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue: string | null | undefined = null; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(encodedSep); - } else if (isPlainObject(pv)) { - encValue = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `${encodeString(k)}${encodedSep}${encodeValue(v)}`; - })?.join(encodedSep); - } else { - encValue = `${encodeValue(pv)}`; - } - - if (encValue == null) { - return; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); - }; -} - -export const encodeForm = formEncoder(","); -export const encodeSpaceDelimited = formEncoder(" "); -export const encodePipeDelimited = formEncoder("|"); - -export function encodeBodyForm( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp = ""; - let encValue = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else if (isPlainObject(pv)) { - encValue = JSON.stringify(pv, jsonReplacer); - } else { - encValue = `${encodeValue(pv)}`; - } - - tmp = `${encodeString(pk)}=${encValue}`; - - // If we end up with the nothing then skip forward - if (!tmp || tmp === "=") { - return; - } - - out += `&${tmp}`; - }); - - return out.slice(1); -} - -export function encodeDeepObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - if (!isPlainObject(value)) { - throw new EncodingError( - `Value of parameter '${key}' which uses deepObject encoding must be an object or null`, - ); - } - - return encodeDeepObjectObject(key, value, options); -} - -export function encodeDeepObjectObject( - key: string, - value: unknown, - options?: { charEncoding?: "percent" | "none" }, -): string | undefined { - if (value == null) { - return; - } - - let out = ""; - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - if (!isPlainObject(value)) { - throw new EncodingError(`Expected parameter '${key}' to be an object.`); - } - - Object.entries(value).forEach(([ck, cv]) => { - if (cv == null) { - return; - } - - const pk = `${key}[${ck}]`; - - if (isPlainObject(cv)) { - const objOut = encodeDeepObjectObject(pk, cv, options); - - out += objOut == null ? "" : `&${objOut}`; - - return; - } - - const pairs: unknown[] = Array.isArray(cv) ? cv : [cv]; - const encoded = mapDefined(pairs, (v) => { - return `${encodeString(pk)}=${encodeString(serializeValue(v))}`; - })?.join("&"); - - out += encoded == null ? "" : `&${encoded}`; - }); - - return out.slice(1); -} - -export function encodeJSON( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined { - if (typeof value === "undefined") { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - - const encVal = encodeString(JSON.stringify(value, jsonReplacer)); - - return options?.explode ? encVal : `${encodeString(key)}=${encVal}`; -} - -export const encodeSimple = ( - key: string, - value: unknown, - options?: { explode?: boolean; charEncoding?: "percent" | "none" }, -): string | undefined => { - let out = ""; - const pairs: [string, unknown][] = options?.explode - ? explode(key, value) - : [[key, value]]; - - if (pairs.every(([_, v]) => v == null)) { - return; - } - - const encodeString = (v: string) => { - return options?.charEncoding === "percent" ? encodeURIComponent(v) : v; - }; - const encodeValue = (v: unknown) => encodeString(serializeValue(v)); - - pairs.forEach(([pk, pv]) => { - let tmp: string | null | undefined = ""; - - if (pv == null) { - return; - } else if (Array.isArray(pv)) { - tmp = mapDefined(pv, (v) => `${encodeValue(v)}`)?.join(","); - } else if (isPlainObject(pv)) { - const mapped = mapDefinedEntries(Object.entries(pv), ([k, v]) => { - return `,${encodeString(k)},${encodeValue(v)}`; - }); - tmp = mapped?.join("").slice(1); - } else { - const k = options?.explode && isPlainObject(value) ? `${pk}=` : ""; - tmp = `${k}${encodeValue(pv)}`; - } - - out += tmp ? `,${tmp}` : ""; - }); - - return out.slice(1); -}; - -function explode(key: string, value: unknown): [string, unknown][] { - if (Array.isArray(value)) { - return value.map((v) => [key, v]); - } else if (isPlainObject(value)) { - const o = value ?? {}; - return Object.entries(o).map(([k, v]) => [k, v]); - } else { - return [[key, value]]; - } -} - -function serializeValue(value: unknown): string { - if (value == null) { - return ""; - } else if (value instanceof Date) { - return value.toISOString(); - } else if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else if (typeof value === "object") { - return JSON.stringify(value, jsonReplacer); - } - - return `${value}`; -} - -function jsonReplacer(_: string, value: unknown): unknown { - if (value instanceof Uint8Array) { - return bytesToBase64(value); - } else { - return value; - } -} - -function mapDefined(inp: T[], mapper: (v: T) => R): R[] | null { - const res = inp.reduce((acc, v) => { - if (v == null) { - return acc; - } - - const m = mapper(v); - if (m == null) { - return acc; - } - - acc.push(m); - - return acc; - }, []); - - return res.length ? res : null; -} - -function mapDefinedEntries( - inp: Iterable<[K, V]>, - mapper: (v: [K, V]) => R, -): R[] | null { - const acc: R[] = []; - for (const [k, v] of inp) { - if (v == null) { - continue; - } - - const m = mapper([k, v]); - if (m == null) { - continue; - } - - acc.push(m); - } - - return acc.length ? acc : null; -} - -export function queryJoin(...args: (string | undefined)[]): string { - return args.filter(Boolean).join("&"); -} - -type QueryEncoderOptions = { - explode?: boolean; - charEncoding?: "percent" | "none"; - allowEmptyValue?: string[]; -}; - -type QueryEncoder = ( - key: string, - value: unknown, - options?: QueryEncoderOptions, -) => string | undefined; - -type BulkQueryEncoder = ( - values: Record, - options?: QueryEncoderOptions, -) => string; - -export function queryEncoder(f: QueryEncoder): BulkQueryEncoder { - const bulkEncode = function( - values: Record, - options?: QueryEncoderOptions, - ): string { - const opts: QueryEncoderOptions = { - ...options, - explode: options?.explode ?? true, - charEncoding: options?.charEncoding ?? "percent", - }; - - const allowEmptySet = new Set(options?.allowEmptyValue ?? []); - - const encoded = Object.entries(values).map(([key, value]) => { - if (allowEmptySet.has(key)) { - if ( - value === undefined - || value === null - || value === "" - || (Array.isArray(value) && value.length === 0) - ) { - return `${encodeURIComponent(key)}=`; - } - } - return f(key, value, opts); - }); - return queryJoin(...encoded); - }; - - return bulkEncode; -} - -export const encodeJSONQuery = queryEncoder(encodeJSON); -export const encodeFormQuery = queryEncoder(encodeForm); -export const encodeSpaceDelimitedQuery = queryEncoder(encodeSpaceDelimited); -export const encodePipeDelimitedQuery = queryEncoder(encodePipeDelimited); -export const encodeDeepObjectQuery = queryEncoder(encodeDeepObject); - -function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const tag = val[Symbol.toStringTag]; - if (tag !== "Blob" && tag !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} - -export function appendForm( - fd: FormData, - key: string, - value: unknown, - fileName?: string, -): void { - if (value == null) { - return; - } else if (isBlobLike(value)) { - if (fileName) { - fd.append(key, value as Blob, fileName); - } else { - fd.append(key, value as Blob); - } - } else { - fd.append(key, String(value)); - } -} - -export async function normalizeBlob( - value: Pick, -): Promise { - if (value instanceof Blob) { - return value; - } - return new Blob([await value.arrayBuffer()], { type: value.type }); -} diff --git a/sync-for-expenses/src/lib/files.ts b/sync-for-expenses/src/lib/files.ts index 6ca6b37d3..1427b8cf6 100644 --- a/sync-for-expenses/src/lib/files.ts +++ b/sync-for-expenses/src/lib/files.ts @@ -1,104 +1,17 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Consumes a stream and returns a concatenated array buffer. Useful in - * situations where we need to read the whole file because it forms part of a - * larger payload containing other fields, and we can't modify the underlying - * request structure. - */ -export async function readableStreamToArrayBuffer( - readable: ReadableStream, -): Promise { - const reader = readable.getReader(); - const chunks: Uint8Array[] = []; - - let totalLength = 0; - let done = false; - - while (!done) { - const { value, done: doneReading } = await reader.read(); - - if (doneReading) { - done = true; - } else { - chunks.push(value); - totalLength += value.length; - } - } - - const concatenatedChunks = new Uint8Array(totalLength); - let offset = 0; - - for (const chunk of chunks) { - concatenatedChunks.set(chunk, offset); - offset += chunk.length; - } - - return concatenatedChunks.buffer as ArrayBuffer; +export function bytesToBlob(content: unknown, contentType: string): Blob { + void content; + return new Blob([], { type: contentType }); } -/** - * Determines the MIME content type based on a file's extension. - * Returns null if the extension is not recognized. - */ -export function getContentTypeFromFileName(fileName: string): string | null { - if (!fileName) return null; - - const ext = fileName.toLowerCase().split(".").pop(); - if (!ext) return null; - - const mimeTypes: Record = { - json: "application/json", - xml: "application/xml", - html: "text/html", - htm: "text/html", - txt: "text/plain", - csv: "text/csv", - pdf: "application/pdf", - png: "image/png", - jpg: "image/jpeg", - jpeg: "image/jpeg", - gif: "image/gif", - svg: "image/svg+xml", - js: "application/javascript", - css: "text/css", - zip: "application/zip", - tar: "application/x-tar", - gz: "application/gzip", - mp4: "video/mp4", - mp3: "audio/mpeg", - wav: "audio/wav", - webp: "image/webp", - ico: "image/x-icon", - woff: "font/woff", - woff2: "font/woff2", - ttf: "font/ttf", - otf: "font/otf", - }; - - return mimeTypes[ext] || null; +export function getContentTypeFromFileName(fileName: string): string { + void fileName; + return "application/octet-stream"; } -/** - * Creates a Blob from file content with the given MIME type. - * - * Node.js Buffers are Uint8Array subclasses that may share a pooled - * ArrayBuffer (byteOffset > 0, byteLength < buffer.byteLength). Passing - * such a Buffer directly to `new Blob([buf])` can include the entire - * underlying pool on some runtimes, producing a Blob with extra bytes - * that corrupts multipart uploads. - * - * Copying into a standalone Uint8Array ensures the Blob receives only the - * intended bytes regardless of runtime behaviour. - */ -export function bytesToBlob( - content: Uint8Array | ArrayBuffer | Blob | string, - contentType: string, -): Blob { - if (content instanceof Uint8Array) { - return new Blob([new Uint8Array(content)], { type: contentType }); - } - return new Blob([content as BlobPart], { type: contentType }); +export async function readableStreamToArrayBuffer(readable: unknown): Promise { + void readable; + return new ArrayBuffer(0); } diff --git a/sync-for-expenses/src/lib/http.ts b/sync-for-expenses/src/lib/http.ts deleted file mode 100644 index 13cf1fd78..000000000 --- a/sync-for-expenses/src/lib/http.ts +++ /dev/null @@ -1,323 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type Fetcher = ( - input: RequestInfo | URL, - init?: RequestInit, -) => Promise; - -export type Awaitable = T | Promise; - -const DEFAULT_FETCHER: Fetcher = (input, init) => { - // If input is a Request and init is undefined, Bun will discard the method, - // headers, body and other options that were set on the request object. - // Node.js and browers would ignore an undefined init value. This check is - // therefore needed for interop with Bun. - if (init == null) { - return fetch(input); - } else { - return fetch(input, init); - } -}; - -export type RequestInput = { - /** - * The URL the request will use. - */ - url: URL; - /** - * Options used to create a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request). - */ - options?: RequestInit | undefined; -}; - -export interface HTTPClientOptions { - fetcher?: Fetcher; -} - -export type BeforeRequestHook = (req: Request) => Awaitable; -export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; -export type ResponseHook = (res: Response, req: Request) => Awaitable; - -export class HTTPClient { - private fetcher: Fetcher; - private requestHooks: BeforeRequestHook[] = []; - private requestErrorHooks: RequestErrorHook[] = []; - private responseHooks: ResponseHook[] = []; - - constructor(private options: HTTPClientOptions = {}) { - this.fetcher = options.fetcher || DEFAULT_FETCHER; - } - - async request(request: Request): Promise { - let req = request; - for (const hook of this.requestHooks) { - const nextRequest = await hook(req); - if (nextRequest) { - req = nextRequest; - } - } - - try { - const res = await this.fetcher(req); - - for (const hook of this.responseHooks) { - await hook(res, req); - } - - return res; - } catch (err) { - for (const hook of this.requestErrorHooks) { - await hook(err, req); - } - - throw err; - } - } - - /** - * Registers a hook that is called before a request is made. The hook function - * can mutate the request or return a new request. This may be useful to add - * additional information to request such as request IDs and tracing headers. - */ - addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** - * Registers a hook that is called when a request cannot be made due to a - * network error. - */ - addHook(hook: "requestError", fn: RequestErrorHook): this; - /** - * Registers a hook that is called when a response has been received from the - * server. - */ - addHook(hook: "response", fn: ResponseHook): this; - addHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ) { - if (args[0] === "beforeRequest") { - this.requestHooks.push(args[1]); - } else if (args[0] === "requestError") { - this.requestErrorHooks.push(args[1]); - } else if (args[0] === "response") { - this.responseHooks.push(args[1]); - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - return this; - } - - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "requestError", fn: RequestErrorHook): this; - /** Removes a hook that was previously registered with `addHook`. */ - removeHook(hook: "response", fn: ResponseHook): this; - removeHook( - ...args: - | [hook: "beforeRequest", fn: BeforeRequestHook] - | [hook: "requestError", fn: RequestErrorHook] - | [hook: "response", fn: ResponseHook] - ): this { - let target: unknown[]; - if (args[0] === "beforeRequest") { - target = this.requestHooks; - } else if (args[0] === "requestError") { - target = this.requestErrorHooks; - } else if (args[0] === "response") { - target = this.responseHooks; - } else { - throw new Error(`Invalid hook type: ${args[0]}`); - } - - const index = target.findIndex((v) => v === args[1]); - if (index >= 0) { - target.splice(index, 1); - } - - return this; - } - - clone(): HTTPClient { - const child = new HTTPClient(this.options); - child.requestHooks = this.requestHooks.slice(); - child.requestErrorHooks = this.requestErrorHooks.slice(); - child.responseHooks = this.responseHooks.slice(); - - return child; - } -} - -export type StatusCodePredicate = number | string | (number | string)[]; - -// A semicolon surrounded by optional whitespace characters is used to separate -// segments in a media type string. -const mediaParamSeparator = /\s*;\s*/g; - -export function matchContentType(response: Response, pattern: string): boolean { - // `*` is a special case which means anything is acceptable. - if (pattern === "*") { - return true; - } - - let contentType = - response.headers.get("content-type")?.trim() || "application/octet-stream"; - contentType = contentType.toLowerCase(); - - const wantParts = pattern.toLowerCase().trim().split(mediaParamSeparator); - const [wantType = "", ...wantParams] = wantParts; - - if (wantType.split("/").length !== 2) { - return false; - } - - const gotParts = contentType.split(mediaParamSeparator); - const [gotType = "", ...gotParams] = gotParts; - - const [type = "", subtype = ""] = gotType.split("/"); - if (!type || !subtype) { - return false; - } - - if ( - wantType !== "*/*" && - gotType !== wantType && - `${type}/*` !== wantType && - `*/${subtype}` !== wantType - ) { - return false; - } - - if (gotParams.length < wantParams.length) { - return false; - } - - const params = new Set(gotParams); - for (const wantParam of wantParams) { - if (!params.has(wantParam)) { - return false; - } - } - - return true; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -export function matchStatusCode( - response: Response, - codes: StatusCodePredicate, -): boolean { - const actual = `${response.status}`; - const expectedCodes = Array.isArray(codes) ? codes : [codes]; - if (!expectedCodes.length) { - return false; - } - - return expectedCodes.some((ec) => { - const code = `${ec}`; - - if (code === "default") { - return true; - } - - if (!codeRangeRE.test(`${code}`)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -export function matchResponse( - response: Response, - code: StatusCodePredicate, - contentTypePattern: string, -): boolean { - return ( - matchStatusCode(response, code) && - matchContentType(response, contentTypePattern) - ); -} - -/** - * Uses various heurisitics to determine if an error is a connection error. - */ -export function isConnectionError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Covers fetch in Deno as well - const isBrowserErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("failed to fetch"); - - const isNodeErr = - err instanceof TypeError && - err.message.toLowerCase().startsWith("fetch failed"); - - const isBunErr = "name" in err && err.name === "ConnectionError"; - - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnreset"; - - return isBrowserErr || isNodeErr || isGenericErr || isBunErr; -} - -/** - * Uses various heurisitics to determine if an error is a timeout error. - */ -export function isTimeoutError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "TimeoutError"; - const isLegacyNative = "code" in err && err.code === 23; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} - -/** - * Uses various heurisitics to determine if an error is a abort error. - */ -export function isAbortError(err: unknown): boolean { - if (typeof err !== "object" || err == null) { - return false; - } - - // Fetch in browser, Node.js, Bun, Deno - const isNative = "name" in err && err.name === "AbortError"; - const isLegacyNative = "code" in err && err.code === 20; - - // Node.js HTTP client and Axios - const isGenericErr = - "code" in err && - typeof err.code === "string" && - err.code.toLowerCase() === "econnaborted"; - - return isNative || isLegacyNative || isGenericErr; -} diff --git a/sync-for-expenses/src/lib/is-plain-object.ts b/sync-for-expenses/src/lib/is-plain-object.ts deleted file mode 100644 index 61070d3d7..000000000 --- a/sync-for-expenses/src/lib/is-plain-object.ts +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -/* -MIT License - -Copyright (c) Sindre Sorhus (https://sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -*/ - -// Taken from https://github.com/sindresorhus/is-plain-obj/blob/97f38e8836f86a642cce98fc6ab3058bc36df181/index.js - -export function isPlainObject(value: unknown): value is object { - if (typeof value !== "object" || value === null) { - return false; - } - - const prototype = Object.getPrototypeOf(value); - return ( - (prototype === null || - prototype === Object.prototype || - Object.getPrototypeOf(prototype) === null) && - !(Symbol.toStringTag in value) && - !(Symbol.iterator in value) - ); -} diff --git a/sync-for-expenses/src/lib/logger.ts b/sync-for-expenses/src/lib/logger.ts deleted file mode 100644 index d181f2937..000000000 --- a/sync-for-expenses/src/lib/logger.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export interface Logger { - group(label?: string): void; - groupEnd(): void; - log(message: any, ...args: any[]): void; -} diff --git a/sync-for-expenses/src/lib/matchers.ts b/sync-for-expenses/src/lib/matchers.ts deleted file mode 100644 index b096d6f20..000000000 --- a/sync-for-expenses/src/lib/matchers.ts +++ /dev/null @@ -1,346 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { ResponseValidationError } from "../sdk/models/errors/responsevalidationerror.js"; -import { SDKError } from "../sdk/models/errors/sdkerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { matchResponse, matchStatusCode, StatusCodePredicate } from "./http.js"; -import { isPlainObject } from "./is-plain-object.js"; - -export type Encoding = - | "jsonl" - | "json" - | "text" - | "bytes" - | "stream" - | "sse" - | "nil" - | "fail"; - -const DEFAULT_CONTENT_TYPES: Record = { - jsonl: "application/jsonl", - json: "application/json", - text: "text/plain", - bytes: "application/octet-stream", - stream: "application/octet-stream", - sse: "text/event-stream", - nil: "*", - fail: "*", -}; - -type Schema = { parse(raw: unknown): T }; - -type MatchOptions = { - ctype?: string; - hdrs?: boolean; - key?: string; - sseSentinel?: string; -}; - -export type ValueMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; -}; - -export type ErrorMatcher = MatchOptions & { - enc: Encoding; - codes: StatusCodePredicate; - schema: Schema; - err: true; -}; - -export type FailMatcher = { - enc: "fail"; - codes: StatusCodePredicate; -}; - -export type Matcher = ValueMatcher | ErrorMatcher | FailMatcher; - -export function jsonErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "json", codes, schema }; -} -export function json( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "json", codes, schema }; -} - -export function jsonl( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "jsonl", codes, schema }; -} - -export function jsonlErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "jsonl", codes, schema }; -} -export function textErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "text", codes, schema }; -} -export function text( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "text", codes, schema }; -} - -export function bytesErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "bytes", codes, schema }; -} -export function bytes( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "bytes", codes, schema }; -} - -export function streamErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "stream", codes, schema }; -} -export function stream( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "stream", codes, schema }; -} - -export function sseErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "sse", codes, schema }; -} -export function sse( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "sse", codes, schema }; -} - -export function nilErr( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ErrorMatcher { - return { ...options, err: true, enc: "nil", codes, schema }; -} -export function nil( - codes: StatusCodePredicate, - schema: Schema, - options?: MatchOptions, -): ValueMatcher { - return { ...options, enc: "nil", codes, schema }; -} - -export function fail(codes: StatusCodePredicate): FailMatcher { - return { enc: "fail", codes }; -} - -export type MatchedValue = Matchers extends Matcher[] - ? T - : never; -export type MatchedError = Matchers extends Matcher[] - ? E - : never; -export type MatchFunc = ( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, -) => Promise<[result: Result, raw: unknown]>; - -export function match( - ...matchers: Array> -): MatchFunc { - return async function matchFunc( - response: Response, - request: Request, - options?: { resultKey?: string; extraFields?: Record }, - ): Promise< - [result: Result, raw: unknown] - > { - let raw: unknown; - let matcher: Matcher | undefined; - for (const match of matchers) { - const { codes } = match; - const ctpattern = "ctype" in match - ? match.ctype - : DEFAULT_CONTENT_TYPES[match.enc]; - if (ctpattern && matchResponse(response, codes, ctpattern)) { - matcher = match; - break; - } else if (!ctpattern && matchStatusCode(response, codes)) { - matcher = match; - break; - } - } - - if (!matcher) { - return [{ - ok: false, - error: new SDKError("Unexpected Status or Content-Type", { - response, - request, - body: await response.text().catch(() => ""), - }), - }, raw]; - } - - const encoding = matcher.enc; - let body = ""; - switch (encoding) { - case "json": - body = await response.text(); - raw = JSON.parse(body); - break; - case "jsonl": - raw = response.body; - break; - case "bytes": - raw = new Uint8Array(await response.arrayBuffer()); - break; - case "stream": - raw = response.body; - break; - case "text": - body = await response.text(); - raw = body; - break; - case "sse": - raw = response.body; - break; - case "nil": - body = await response.text(); - raw = undefined; - break; - case "fail": - body = await response.text(); - raw = body; - break; - default: - throw new Error( - `Unsupported response type: ${encoding satisfies never}`, - ); - } - - if (matcher.enc === "fail") { - return [{ - ok: false, - error: new SDKError("API error occurred", { request, response, body }), - }, raw]; - } - - const resultKey = matcher.key || options?.resultKey; - let data: unknown; - - if ("err" in matcher) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - request$: request, - response$: response, - body$: body, - }; - } else if (resultKey) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - [resultKey]: raw, - }; - } else if (matcher.hdrs) { - data = { - ...options?.extraFields, - ...(matcher.hdrs ? { Headers: unpackHeaders(response.headers) } : null), - ...(isPlainObject(raw) ? raw : null), - }; - } else { - data = raw; - } - - if ("err" in matcher) { - const result = safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ); - return [result.ok ? { ok: false, error: result.value } : result, raw]; - } else { - return [ - safeParseResponse( - data, - (v: unknown) => matcher.schema.parse(v), - "Response validation failed", - { request, response, body }, - ), - raw, - ]; - } - }; -} - -const headerValRE = /, */; -/** - * Iterates over a Headers object and returns an object with all the header - * entries. Values are represented as an array to account for repeated headers. - */ -export function unpackHeaders(headers: Headers): Record { - const out: Record = {}; - - for (const [k, v] of headers.entries()) { - out[k] = v.split(headerValRE); - } - - return out; -} - -function safeParseResponse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, - httpMeta: { response: Response; request: Request; body: string }, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR( - new ResponseValidationError(errorMessage, { - cause: err, - rawValue, - rawMessage: errorMessage, - ...httpMeta, - }), - ); - } -} diff --git a/sync-for-expenses/src/lib/primitives.ts b/sync-for-expenses/src/lib/primitives.ts deleted file mode 100644 index d21f1dc49..000000000 --- a/sync-for-expenses/src/lib/primitives.ts +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -class InvariantError extends Error { - constructor(message: string) { - super(message); - this.name = "InvariantError"; - } -} - -export function invariant( - condition: unknown, - message: string, -): asserts condition { - if (!condition) { - throw new InvariantError(message); - } -} - -export type ExactPartial = { - [P in keyof T]?: T[P] | undefined; -}; - -export type Remap = { - [k in keyof Inp as Mapping[k] extends string /* if we have a string mapping for this key then use it */ - ? Mapping[k] - : Mapping[k] extends null /* if the mapping is to `null` then drop the key */ - ? never - : k /* otherwise keep the key as-is */]: Inp[k]; -}; - -/** - * Converts or omits an object's keys according to a mapping. - * - * @param inp An object whose keys will be remapped - * @param mappings A mapping of original keys to new keys. If a key is not present in the mapping, it will be left as is. If a key is mapped to `null`, it will be removed in the resulting object. - * @returns A new object with keys remapped or omitted according to the mappings - */ -export function remap< - Inp extends Record, - const Mapping extends { [k in keyof Inp]?: string | null }, ->(inp: Inp, mappings: Mapping): Remap { - let out: any = {}; - - if (!Object.keys(mappings).length) { - out = inp; - return out; - } - - for (const [k, v] of Object.entries(inp)) { - const j = mappings[k]; - if (j === null) { - continue; - } - out[j ?? k] = v; - } - - return out; -} - -export function combineSignals( - ...signals: Array -): AbortSignal | null { - const filtered: AbortSignal[] = []; - for (const signal of signals) { - if (signal) { - filtered.push(signal); - } - } - - switch (filtered.length) { - case 0: - case 1: - return filtered[0] || null; - default: - if ("any" in AbortSignal && typeof AbortSignal.any === "function") { - return AbortSignal.any(filtered); - } - return abortSignalAny(filtered); - } -} - -export function abortSignalAny(signals: AbortSignal[]): AbortSignal { - const controller = new AbortController(); - const result = controller.signal; - if (!signals.length) { - return controller.signal; - } - - if (signals.length === 1) { - return signals[0] || controller.signal; - } - - for (const signal of signals) { - if (signal.aborted) { - return signal; - } - } - - function abort(this: AbortSignal) { - controller.abort(this.reason); - clean(); - } - - const signalRefs: WeakRef[] = []; - function clean() { - for (const signalRef of signalRefs) { - const signal = signalRef.deref(); - if (signal) { - signal.removeEventListener("abort", abort); - } - } - } - - for (const signal of signals) { - signalRefs.push(new WeakRef(signal)); - signal.addEventListener("abort", abort); - } - - return result; -} - -export function compactMap( - values: Record, -): Record { - const out: Record = {}; - - for (const [k, v] of Object.entries(values)) { - if (typeof v !== "undefined") { - out[k] = v; - } - } - - return out; -} - -export function allRequired>( - v: V, -): - | { - [K in keyof V]: NonNullable; - } - | undefined { - if (Object.values(v).every((x) => x == null)) { - return void 0; - } - - return v as ReturnType>; -} diff --git a/sync-for-expenses/src/lib/retries.ts b/sync-for-expenses/src/lib/retries.ts deleted file mode 100644 index e3ce9aba7..000000000 --- a/sync-for-expenses/src/lib/retries.ts +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { isConnectionError, isTimeoutError } from "./http.js"; - -export type BackoffStrategy = { - initialInterval: number; - maxInterval: number; - exponent: number; - maxElapsedTime: number; -}; - -const defaultBackoff: BackoffStrategy = { - initialInterval: 500, - maxInterval: 60000, - exponent: 1.5, - maxElapsedTime: 3600000, -}; - -export type RetryConfig = - | { strategy: "none" } - | { - strategy: "backoff"; - backoff?: BackoffStrategy; - retryConnectionErrors?: boolean; - }; - -/** - * PermanentError is an error that is not recoverable. Throwing this error will - * cause a retry loop to terminate. - */ -export class PermanentError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - - constructor(message: string, options?: { cause?: unknown }) { - let msg = message; - if (options?.cause) { - msg += `: ${options.cause}`; - } - - super(msg, options); - this.name = "PermanentError"; - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = options?.cause; - } - - Object.setPrototypeOf(this, PermanentError.prototype); - } -} - -/** - * TemporaryError is an error is used to signal that an HTTP request can be - * retried as part of a retry loop. If retry attempts are exhausted and this - * error is thrown, the response will be returned to the caller. - */ -export class TemporaryError extends Error { - response: Response; - - constructor(message: string, response: Response) { - super(message); - this.response = response; - this.name = "TemporaryError"; - - Object.setPrototypeOf(this, TemporaryError.prototype); - } -} - -export async function retry( - fetchFn: () => Promise, - options: { - config: RetryConfig; - statusCodes: string[]; - }, -): Promise { - switch (options.config.strategy) { - case "backoff": - return retryBackoff( - wrapFetcher(fetchFn, { - statusCodes: options.statusCodes, - retryConnectionErrors: !!options.config.retryConnectionErrors, - }), - options.config.backoff ?? defaultBackoff, - ); - default: - return await fetchFn(); - } -} - -function wrapFetcher( - fn: () => Promise, - options: { - statusCodes: string[]; - retryConnectionErrors: boolean; - }, -): () => Promise { - return async () => { - try { - const res = await fn(); - if (isRetryableResponse(res, options.statusCodes)) { - throw new TemporaryError( - "Response failed with retryable status code", - res, - ); - } - - return res; - } catch (err: unknown) { - if (err instanceof TemporaryError) { - throw err; - } - - if ( - options.retryConnectionErrors && - (isTimeoutError(err) || isConnectionError(err)) - ) { - throw err; - } - - throw new PermanentError("Permanent error", { cause: err }); - } - }; -} - -const codeRangeRE = new RegExp("^[0-9]xx$", "i"); - -function isRetryableResponse(res: Response, statusCodes: string[]): boolean { - const actual = `${res.status}`; - - return statusCodes.some((code) => { - if (!codeRangeRE.test(code)) { - return code === actual; - } - - const expectFamily = code.charAt(0); - if (!expectFamily) { - throw new Error("Invalid status code range"); - } - - const actualFamily = actual.charAt(0); - if (!actualFamily) { - throw new Error(`Invalid response status code: ${actual}`); - } - - return actualFamily === expectFamily; - }); -} - -async function retryBackoff( - fn: () => Promise, - strategy: BackoffStrategy, -): Promise { - const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; - - const start = Date.now(); - let x = 0; - - while (true) { - try { - const res = await fn(); - return res; - } catch (err: unknown) { - if (err instanceof PermanentError) { - throw err.cause; - } - const elapsed = Date.now() - start; - if (elapsed > maxElapsedTime) { - if (err instanceof TemporaryError) { - return err.response; - } - - throw err; - } - - let retryInterval = 0; - if (err instanceof TemporaryError) { - retryInterval = retryIntervalFromResponse(err.response); - } - - if (retryInterval <= 0) { - retryInterval = - initialInterval * Math.pow(x, exponent) + Math.random() * 1000; - } - - const d = Math.min(retryInterval, maxInterval); - - await delay(d); - x++; - } - } -} - -function retryIntervalFromResponse(res: Response): number { - const retryVal = res.headers.get("retry-after") || ""; - if (!retryVal) { - return 0; - } - - const parsedNumber = Number(retryVal); - if (Number.isInteger(parsedNumber)) { - return parsedNumber * 1000; - } - - const parsedDate = Date.parse(retryVal); - if (Number.isInteger(parsedDate)) { - const deltaMS = parsedDate - Date.now(); - return deltaMS > 0 ? Math.ceil(deltaMS) : 0; - } - - return 0; -} - -async function delay(delay: number): Promise { - return new Promise((resolve) => setTimeout(resolve, delay)); -} diff --git a/sync-for-expenses/src/lib/schemas.ts b/sync-for-expenses/src/lib/schemas.ts deleted file mode 100644 index dc2510e33..000000000 --- a/sync-for-expenses/src/lib/schemas.ts +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { - output, - ZodEffects, - ZodError, - ZodObject, - ZodRawShape, - ZodTypeAny, -} from "zod/v3"; -import { SDKValidationError } from "../sdk/models/errors/sdkvalidationerror.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; - -/** - * Utility function that executes some code which may throw a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function parse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Out { - try { - return fn(rawValue); - } catch (err) { - if (err instanceof ZodError) { - throw new SDKValidationError(errorMessage, err, rawValue); - } - throw err; - } -} - -/** - * Utility function that executes some code which may result in a ZodError. It - * intercepts this error and converts it to an SDKValidationError so as to not - * leak Zod implementation details to user code. - */ -export function safeParse( - rawValue: Inp, - fn: (value: Inp) => Out, - errorMessage: string, -): Result { - try { - return OK(fn(rawValue)); - } catch (err) { - return ERR(new SDKValidationError(errorMessage, err, rawValue)); - } -} - -export function collectExtraKeys< - Shape extends ZodRawShape, - Catchall extends ZodTypeAny, - K extends string, ->( - obj: ZodObject, - extrasKey: K, - optional: boolean, -): ZodEffects< - typeof obj, - & output> - & { - [k in K]: Record>; - } -> { - return obj.transform((val) => { - const extras: Record> = {}; - const { shape } = obj; - for (const [key] of Object.entries(val)) { - if (key in shape) { - continue; - } - - const v = val[key]; - if (typeof v === "undefined") { - continue; - } - - extras[key] = v; - delete val[key]; - } - - if (optional && Object.keys(extras).length === 0) { - return val; - } - - return { ...val, [extrasKey]: extras }; - }); -} diff --git a/sync-for-expenses/src/lib/sdkconfig.ts b/sync-for-expenses/src/lib/sdkconfig.ts new file mode 100644 index 000000000..eea0baaa8 --- /dev/null +++ b/sync-for-expenses/src/lib/sdkconfig.ts @@ -0,0 +1,473 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type { SDKHooks } from "../hooks/hooks"; +import type { HookContext } from "../hooks/types"; + +export type Fetcher = (input: RequestInfo | URL, init?: RequestInit) => Promise; + +export type RequestInput = { + url: URL; + options?: RequestInit | undefined; +}; + +export type Awaitable = T | Promise; + +export type BeforeRequestHook = (req: Request) => Awaitable; +export type RequestErrorHook = (err: unknown, req: Request) => Awaitable; +export type ResponseHook = (res: Response, req: Request) => Awaitable; + +const DEFAULT_FETCHER: Fetcher = (input, init) => (init == null ? fetch(input) : fetch(input, init)); + +export class HTTPClient { + private fetcher: Fetcher; + private requestHooks: BeforeRequestHook[] = []; + private requestErrorHooks: RequestErrorHook[] = []; + private responseHooks: ResponseHook[] = []; + + constructor(private options: HTTPClientOptions = {}) { + this.fetcher = options.fetcher || DEFAULT_FETCHER; + } + + async request(request: Request): Promise { + let req = request; + for (const hook of this.requestHooks) { + const next = await hook(req); + if (next) { + req = next; + } + } + try { + const res = await this.fetcher(req); + for (const hook of this.responseHooks) { + await hook(res, req); + } + return res; + } catch (err) { + for (const hook of this.requestErrorHooks) { + await hook(err, req); + } + throw err; + } + } + + addHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + addHook(hook: "requestError", fn: RequestErrorHook): this; + addHook(hook: "response", fn: ResponseHook): this; + addHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + if (hook === "beforeRequest") { + this.requestHooks.push(fn as BeforeRequestHook); + } else if (hook === "requestError") { + this.requestErrorHooks.push(fn as RequestErrorHook); + } else if (hook === "response") { + this.responseHooks.push(fn as ResponseHook); + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + return this; + } + + removeHook(hook: "beforeRequest", fn: BeforeRequestHook): this; + removeHook(hook: "requestError", fn: RequestErrorHook): this; + removeHook(hook: "response", fn: ResponseHook): this; + removeHook(hook: string, fn: BeforeRequestHook | RequestErrorHook | ResponseHook): this { + let target: unknown[]; + if (hook === "beforeRequest") { + target = this.requestHooks; + } else if (hook === "requestError") { + target = this.requestErrorHooks; + } else if (hook === "response") { + target = this.responseHooks; + } else { + throw new Error(`Invalid hook type: ${hook}`); + } + const index = target.findIndex((v) => v === fn); + if (index >= 0) { + target.splice(index, 1); + } + return this; + } + + clone(): HTTPClient { + const child = new HTTPClient(this.options); + child.requestHooks = this.requestHooks.slice(); + child.requestErrorHooks = this.requestErrorHooks.slice(); + child.responseHooks = this.responseHooks.slice(); + return child; + } +} + +export interface HTTPClientOptions { + fetcher?: Fetcher; +} + +export interface Logger { + group(label?: string): void; + groupEnd(): void; + log(...args: unknown[]): void; +} + +export type BackoffStrategy = { + initialInterval: number; + maxInterval: number; + exponent: number; + maxElapsedTime: number; +}; + +export type RetryConfig = + | { strategy: "none" } + | { + strategy: "backoff"; + backoff?: BackoffStrategy; + retryConnectionErrors?: boolean; + }; + +export interface SDKOptions { + authHeader?: string | (() => Promise) | undefined; + debugLogger?: Logger; + httpClient?: HTTPClient; + retryConfig?: RetryConfig; + serverIdx?: number | undefined; + serverURL?: string | undefined; + timeoutMs?: number; + userAgent?: string | undefined; +} + +export type Security = { + authHeader: string; +}; + +export const ServerList = ["https://api.codat.io"] as const; + +export const SDK_METADATA = { + language: "typescript", + genVersion: "codat-sdk-codegen-poc-0.1.0", + sdkVersion: "prealpha", + openapiDocVersion: "prealpha", + userAgent: "codat-sdk/typescript prealpha codat-sdk-codegen-poc-0.1.0 prealpha @codat/sync-for-expenses", +} as const; + +export function resolveServerURL(options: SDKOptions = {}): string { + const fromList = ServerList[options.serverIdx ?? 0] ?? ServerList[0]; + return (options.serverURL ?? fromList).replace(/\/+$/, ""); +} + +export function resolveAuthHeader( + authHeader: SDKOptions["authHeader"], +): string | ((name: string) => Promise) | undefined { + if (authHeader == null) { + return undefined; + } + if (typeof authHeader === "function") { + return () => authHeader(); + } + return authHeader; +} + +const DEFAULT_RETRY_CODES = ["408", "429", "5XX"]; + +const DEFAULT_RETRY_CONFIG: RetryConfig = { + strategy: "backoff", + backoff: { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + retryConnectionErrors: true, +}; + +class PermanentError extends Error { + readonly cause: unknown; + constructor(message: string, options?: { cause?: unknown }) { + super(message); + this.name = "PermanentError"; + this.cause = options?.cause; + } +} + +class TemporaryError extends Error { + readonly response: Response; + constructor(message: string, response: Response) { + super(message); + this.name = "TemporaryError"; + this.response = response; + } +} + +function isConnectionError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const msg = err instanceof TypeError ? err.message.toLowerCase() : ""; + const isFetchErr = msg.startsWith("failed to fetch") || msg.startsWith("fetch failed"); + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return isFetchErr || code === "econnreset"; +} + +function isTimeoutError(err: unknown): boolean { + if (typeof err !== "object" || err == null) { + return false; + } + const name = "name" in err ? (err as { name?: unknown }).name : ""; + const code = "code" in err ? String((err as { code?: unknown }).code).toLowerCase() : ""; + return name === "TimeoutError" || code === "econnaborted"; +} + +const codeRangeRE = /^[0-9]xx$/i; + +function isRetryableResponse(res: Response, statusCodes: string[]): boolean { + const actual = `${res.status}`; + return statusCodes.some((code) => { + if (!codeRangeRE.test(code)) { + return code === actual; + } + return actual.charAt(0) === code.charAt(0); + }); +} + +function retryIntervalFromResponse(res: Response): number { + const retryVal = res.headers.get("retry-after") || ""; + if (!retryVal) { + return 0; + } + const asNumber = Number(retryVal); + if (Number.isInteger(asNumber)) { + return asNumber * 1000; + } + const asDate = Date.parse(retryVal); + if (Number.isInteger(asDate)) { + const deltaMs = asDate - Date.now(); + return deltaMs > 0 ? Math.ceil(deltaMs) : 0; + } + return 0; +} + +function delay(ms: number): Promise { + return new Promise((resolve) => setTimeout(resolve, ms)); +} + +function wrapFetcher( + fn: () => Promise, + statusCodes: string[], + retryConnectionErrors: boolean, +): () => Promise { + return async () => { + try { + const res = await fn(); + if (isRetryableResponse(res, statusCodes)) { + throw new TemporaryError("Response failed with retryable status code", res); + } + return res; + } catch (err: unknown) { + if (err instanceof TemporaryError) { + throw err; + } + if (retryConnectionErrors && (isTimeoutError(err) || isConnectionError(err))) { + throw err; + } + throw new PermanentError("Permanent error", { cause: err }); + } + }; +} + +async function retryBackoff(fn: () => Promise, strategy: BackoffStrategy): Promise { + const { maxElapsedTime, initialInterval, exponent, maxInterval } = strategy; + const start = Date.now(); + let x = 0; + for (;;) { + try { + return await fn(); + } catch (err: unknown) { + if (err instanceof PermanentError) { + throw err.cause; + } + if (Date.now() - start > maxElapsedTime) { + if (err instanceof TemporaryError) { + return err.response; + } + throw err; + } + let retryInterval = err instanceof TemporaryError ? retryIntervalFromResponse(err.response) : 0; + if (retryInterval <= 0) { + retryInterval = initialInterval * Math.pow(x, exponent) + Math.random() * 1000; + } + await delay(Math.min(retryInterval, maxInterval)); + x++; + } + } +} + +function retryRequest(fn: () => Promise, config: RetryConfig, statusCodes: string[]): Promise { + if (config.strategy === "backoff") { + return retryBackoff( + wrapFetcher(fn, statusCodes, !!config.retryConnectionErrors), + config.backoff ?? { initialInterval: 500, maxInterval: 60000, exponent: 1.5, maxElapsedTime: 3600000 }, + ); + } + return fn(); +} + +export function resolveUserAgent(userAgent: string | undefined): Record { + const agent = userAgent ?? SDK_METADATA.userAgent; + if (!agent) { + return {}; + } + const isBrowser = typeof window !== "undefined" && typeof window.document !== "undefined"; + return isBrowser ? {} : { "user-agent": agent }; +} + +function parseURL(input: RequestInfo | URL): URL | null { + try { + return new URL(String(input)); + } catch { + return null; + } +} + +export type SecurityState = { + basic: { username?: string; password?: string }; + headers: Record; + queryParams: Record; + cookies: Record; + oauth2: { type: "none" }; +}; + +function headerValue(headers: HeadersInit | undefined, name: string): string | undefined { + if (!headers) { + return undefined; + } + const lower = name.toLowerCase(); + if (typeof Headers !== "undefined" && headers instanceof Headers) { + return headers.get(name) ?? undefined; + } + if (Array.isArray(headers)) { + const found = headers.find(([k]) => k.toLowerCase() === lower); + return found ? found[1] : undefined; + } + for (const k of Object.keys(headers)) { + if (k.toLowerCase() === lower) { + return (headers as Record)[k]; + } + } + return undefined; +} + +function resolveSecurityState(authValue: string | undefined): SecurityState | null { + if (authValue == null) { + return null; + } + return { + basic: {}, + headers: { Authorization: authValue }, + queryParams: {}, + cookies: {}, + oauth2: { type: "none" }, + }; +} + +export function makeFetch(options: SDKOptions = {}, hooks?: SDKHooks): Fetcher { + const client = options.httpClient; + const logger = options.debugLogger; + return (input, init) => { + const reqInit: RequestInit = init ?? {}; + const stamped = reqInit as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + const operationId = stamped.__codatOperationId; + const config = stamped.__codatRetries ?? options.retryConfig ?? DEFAULT_RETRY_CONFIG; + const retryCodes = stamped.__codatRetryCodes ?? DEFAULT_RETRY_CODES; + for (const key of ["__codatOperationId", "__codatRetries", "__codatRetryCodes"] as const) { + if (key in stamped) { + delete stamped[key]; + } + } + const parsed = parseURL(input); + const ctx: HookContext = { + baseURL: resolveServerURL(options), + operationID: operationId ?? `${(reqInit.method ?? "GET").toUpperCase()} ${parsed ? parsed.pathname : String(input)}`, + oAuth2Scopes: null, + securitySource: options.authHeader, + retryConfig: config, + resolvedSecurity: resolveSecurityState(headerValue(reqInit.headers, "Authorization")), + options, + }; + + let url: RequestInfo | URL = input; + let finalInit: RequestInit = reqInit; + if (hooks && parsed) { + const created = hooks.beforeCreateRequest(ctx, { url: parsed, options: reqInit }); + url = created.url; + finalInit = created.options ?? reqInit; + } + if (!finalInit.signal && options.timeoutMs && options.timeoutMs > 0) { + finalInit = { ...finalInit, signal: AbortSignal.timeout(options.timeoutMs) }; + } + + const dispatch = async (): Promise => { + let request = new Request(url, finalInit); + if (hooks) { + request = await hooks.beforeRequest(ctx, request.clone()); + } + if (logger) { + logger.log(`request: ${request.method} ${request.url}`); + } + let res: Response; + try { + res = client ? await client.request(request) : await fetch(request); + } catch (err) { + if (hooks) { + const handled = await hooks.afterError(ctx, null, err); + if (handled.error) { + throw handled.error; + } + if (handled.response) { + return handled.response; + } + } + throw err; + } + if (logger) { + logger.log(`response: ${res.status}`); + } + if (hooks) { + if (res.status >= 400) { + const handled = await hooks.afterError(ctx, res, null); + if (handled.error) { + throw handled.error; + } + res = handled.response ?? res; + } else { + res = await hooks.afterSuccess(ctx, res); + } + } + return res; + }; + return retryRequest(dispatch, config, retryCodes); + }; +} + +export type StatusCodePredicate = number | string | (number | string)[]; + +export function matchStatusCode(response: Response, codes: StatusCodePredicate): boolean { + const actual = `${response.status}`; + const expectedCodes = Array.isArray(codes) ? codes : [codes]; + if (!expectedCodes.length) { + return false; + } + return expectedCodes.some((ec) => { + const code = `${ec}`; + if (code === "default") { + return true; + } + if (!codeRangeRE.test(code)) { + return code === actual; + } + const expectFamily = code.charAt(0); + if (!expectFamily) { + throw new Error("Invalid status code range"); + } + const actualFamily = actual.charAt(0); + if (!actualFamily) { + throw new Error(`Invalid response status code: ${actual}`); + } + return actualFamily === expectFamily; + }); +} diff --git a/sync-for-expenses/src/lib/sdks.ts b/sync-for-expenses/src/lib/sdks.ts deleted file mode 100644 index 43fcf336e..000000000 --- a/sync-for-expenses/src/lib/sdks.ts +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { SDKHooks } from "../hooks/hooks.js"; -import { HookContext } from "../hooks/types.js"; -import { - ConnectionError, - InvalidRequestError, - RequestAbortedError, - RequestTimeoutError, - UnexpectedClientError, -} from "../sdk/models/errors/httpclienterrors.js"; -import { ERR, OK, Result } from "../sdk/types/fp.js"; -import { stringToBase64 } from "./base64.js"; -import { SDK_METADATA, SDKOptions, serverURLFromOptions } from "./config.js"; -import { encodeForm } from "./encodings.js"; -import { - HTTPClient, - isAbortError, - isConnectionError, - isTimeoutError, - matchContentType, - matchStatusCode, -} from "./http.js"; -import { Logger } from "./logger.js"; -import { retry, RetryConfig } from "./retries.js"; -import { SecurityState } from "./security.js"; - -export type RequestOptions = { - /** - * Sets a timeout, in milliseconds, on HTTP requests made by an SDK method. If - * `fetchOptions.signal` is set then it will take precedence over this option. - */ - timeoutMs?: number; - /** - * Set or override a retry policy on HTTP calls. - */ - retries?: RetryConfig; - /** - * Specifies the status codes which should be retried using the given retry policy. - */ - retryCodes?: string[]; - /** - * Overrides the base server URL that will be used by an operation. - */ - serverURL?: string | URL; - /** - * @deprecated `fetchOptions` has been flattened into `RequestOptions`. - * - * Sets various request options on the `fetch` call made by an SDK method. - * - * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#options|Request} - */ - fetchOptions?: Omit; -} & Omit; - -type RequestConfig = { - method: string; - path: string; - baseURL?: string | URL | undefined; - query?: string; - body?: RequestInit["body"]; - headers?: HeadersInit; - security?: SecurityState | null; - uaHeader?: string; - userAgent?: string | undefined; - timeoutMs?: number; -}; - -const gt: unknown = typeof globalThis === "undefined" ? null : globalThis; -const webWorkerLike = typeof gt === "object" - && gt != null - && "importScripts" in gt - && typeof gt["importScripts"] === "function"; -const isBrowserLike = webWorkerLike - || (typeof navigator !== "undefined" && "serviceWorker" in navigator) - || (typeof window === "object" && typeof window.document !== "undefined"); - -export class ClientSDK { - readonly #httpClient: HTTPClient; - readonly #hooks: SDKHooks; - readonly #logger?: Logger | undefined; - public readonly _baseURL: URL | null; - public readonly _options: SDKOptions & { hooks?: SDKHooks }; - - constructor(options: SDKOptions = {}) { - const opt = options as unknown; - if ( - typeof opt === "object" - && opt != null - && "hooks" in opt - && opt.hooks instanceof SDKHooks - ) { - this.#hooks = opt.hooks; - } else { - this.#hooks = new SDKHooks(); - } - const url = serverURLFromOptions(options); - if (url) { - url.pathname = url.pathname.replace(/\/+$/, "") + "/"; - } - - const { baseURL, client } = this.#hooks.sdkInit({ - baseURL: url, - client: options.httpClient || new HTTPClient(), - }); - this._baseURL = baseURL; - this.#httpClient = client; - - this._options = { ...options, hooks: this.#hooks }; - - this.#logger = this._options.debugLogger; - } - - public _createRequest( - context: HookContext, - conf: RequestConfig, - options?: RequestOptions, - ): Result { - const { method, path, query, headers: opHeaders, security } = conf; - - const base = conf.baseURL ?? this._baseURL; - if (!base) { - return ERR(new InvalidRequestError("No base URL provided for operation")); - } - const baseURL = new URL(base); - let reqURL: URL; - if (path) { - baseURL.pathname = baseURL.pathname.replace(/\/+$/, "") + "/"; - reqURL = new URL(path, baseURL); - } else { - reqURL = baseURL; - } - reqURL.hash = ""; - - let finalQuery = query || ""; - - const secQuery: string[] = []; - for (const [k, v] of Object.entries(security?.queryParams || {})) { - const q = encodeForm(k, v, { charEncoding: "percent" }); - if (typeof q !== "undefined") { - secQuery.push(q); - } - } - if (secQuery.length) { - finalQuery += `&${secQuery.join("&")}`; - } - - if (finalQuery) { - const q = finalQuery.startsWith("&") ? finalQuery.slice(1) : finalQuery; - reqURL.search = `?${q}`; - } - - const headers = new Headers(opHeaders); - - const username = security?.basic.username; - const password = security?.basic.password; - if (username != null || password != null) { - const encoded = stringToBase64( - [username || "", password || ""].join(":"), - ); - headers.set("Authorization", `Basic ${encoded}`); - } - - const securityHeaders = new Headers(security?.headers || {}); - for (const [k, v] of securityHeaders) { - headers.set(k, v); - } - - let cookie = headers.get("cookie") || ""; - for (const [k, v] of Object.entries(security?.cookies || {})) { - cookie += `; ${k}=${v}`; - } - cookie = cookie.startsWith("; ") ? cookie.slice(2) : cookie; - headers.set("cookie", cookie); - - const userHeaders = new Headers( - options?.headers ?? options?.fetchOptions?.headers, - ); - for (const [k, v] of userHeaders) { - headers.set(k, v); - } - - // Only set user agent header in non-browser-like environments since CORS - // policy disallows setting it in browsers e.g. Chrome throws an error. - if (!isBrowserLike) { - headers.set( - conf.uaHeader ?? "user-agent", - conf.userAgent ?? SDK_METADATA.userAgent, - ); - } - - const fetchOptions: Omit = { - ...options?.fetchOptions, - ...options, - }; - if (!fetchOptions?.signal && conf.timeoutMs && conf.timeoutMs > 0) { - const timeoutSignal = AbortSignal.timeout(conf.timeoutMs); - fetchOptions.signal = timeoutSignal; - } - - if (conf.body instanceof ReadableStream) { - Object.assign(fetchOptions, { duplex: "half" }); - } - - let input; - try { - input = this.#hooks.beforeCreateRequest(context, { - url: reqURL, - options: { - ...fetchOptions, - body: conf.body ?? null, - headers, - method, - }, - }); - } catch (err: unknown) { - return ERR( - new UnexpectedClientError("Create request hook failed to execute", { - cause: err, - }), - ); - } - - return OK(new Request(input.url, input.options)); - } - - public async _do( - request: Request, - options: { - context: HookContext; - errorCodes: number | string | (number | string)[]; - retryConfig: RetryConfig; - retryCodes: string[]; - }, - ): Promise< - Result< - Response, - | RequestAbortedError - | RequestTimeoutError - | ConnectionError - | UnexpectedClientError - > - > { - const { context, errorCodes } = options; - - return retry( - async () => { - const req = await this.#hooks.beforeRequest(context, request.clone()); - await logRequest(this.#logger, req).catch((e) => - this.#logger?.log("Failed to log request:", e) - ); - - let response = await this.#httpClient.request(req); - - try { - if (matchStatusCode(response, errorCodes)) { - const result = await this.#hooks.afterError( - context, - response, - null, - ); - if (result.error) { - throw result.error; - } - response = result.response || response; - } else { - response = await this.#hooks.afterSuccess(context, response); - } - } finally { - await logResponse(this.#logger, response, req) - .catch(e => this.#logger?.log("Failed to log response:", e)); - } - - return response; - }, - { config: options.retryConfig, statusCodes: options.retryCodes }, - ).then( - (r) => OK(r), - (err) => { - switch (true) { - case isAbortError(err): - return ERR( - new RequestAbortedError("Request aborted by client", { - cause: err, - }), - ); - case isTimeoutError(err): - return ERR( - new RequestTimeoutError("Request timed out", { cause: err }), - ); - case isConnectionError(err): - return ERR( - new ConnectionError("Unable to make request", { cause: err }), - ); - default: - return ERR( - new UnexpectedClientError("Unexpected HTTP client error", { - cause: err, - }), - ); - } - }, - ); - } -} - -const jsonLikeContentTypeRE = /^(application|text)\/([^+]+\+)*json.*/; -const jsonlLikeContentTypeRE = - /^(application|text)\/([^+]+\+)*(jsonl|x-ndjson)\b.*/; -async function logRequest(logger: Logger | undefined, req: Request) { - if (!logger) { - return; - } - - const contentType = req.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`> Request: ${req.method} ${req.url}`); - - logger.group("Headers:"); - for (const [k, v] of req.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case jsonLikeContentTypeRE.test(ct): - logger.log(await req.clone().json()); - break; - case ct.startsWith("text/"): - logger.log(await req.clone().text()); - break; - case ct === "multipart/form-data": { - const body = await req.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} - -async function logResponse( - logger: Logger | undefined, - res: Response, - req: Request, -) { - if (!logger) { - return; - } - - const contentType = res.headers.get("content-type"); - const ct = contentType?.split(";")[0] || ""; - - logger.group(`< Response: ${req.method} ${req.url}`); - logger.log("Status Code:", res.status, res.statusText); - - logger.group("Headers:"); - for (const [k, v] of res.headers.entries()) { - logger.log(`${k}: ${v}`); - } - logger.groupEnd(); - - logger.group("Body:"); - switch (true) { - case matchContentType(res, "application/json") - || jsonLikeContentTypeRE.test(ct) && !jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().json()); - break; - case matchContentType(res, "application/jsonl") - || jsonlLikeContentTypeRE.test(ct): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "text/event-stream"): - logger.log(`<${contentType}>`); - break; - case matchContentType(res, "text/*"): - logger.log(await res.clone().text()); - break; - case matchContentType(res, "multipart/form-data"): { - const body = await res.clone().formData(); - for (const [k, v] of body) { - const vlabel = v instanceof Blob ? "" : v; - logger.log(`${k}: ${vlabel}`); - } - break; - } - default: - logger.log(`<${contentType}>`); - break; - } - logger.groupEnd(); - - logger.groupEnd(); -} diff --git a/sync-for-expenses/src/lib/security.ts b/sync-for-expenses/src/lib/security.ts deleted file mode 100644 index 3da8e733b..000000000 --- a/sync-for-expenses/src/lib/security.ts +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as shared from "../sdk/models/shared/index.js"; - -type OAuth2PasswordFlow = { - username: string; - password: string; - clientID?: string | undefined; - clientSecret?: string | undefined; - tokenURL: string; -}; - -export enum SecurityErrorCode { - Incomplete = "incomplete", - UnrecognisedSecurityType = "unrecognized_security_type", -} - -export class SecurityError extends Error { - constructor( - public code: SecurityErrorCode, - message: string, - ) { - super(message); - this.name = "SecurityError"; - } - - static incomplete(): SecurityError { - return new SecurityError( - SecurityErrorCode.Incomplete, - "Security requirements not met in order to perform the operation", - ); - } - static unrecognizedType(type: string): SecurityError { - return new SecurityError( - SecurityErrorCode.UnrecognisedSecurityType, - `Unrecognised security type: ${type}`, - ); - } -} - -export type SecurityState = { - basic: { username?: string | undefined; password?: string | undefined }; - headers: Record; - queryParams: Record; - cookies: Record; - oauth2: ({ type: "password" } & OAuth2PasswordFlow) | { type: "none" }; -}; - -type SecurityInputBasic = { - type: "http:basic"; - value: - | { username?: string | undefined; password?: string | undefined } - | null - | undefined; -}; - -type SecurityInputBearer = { - type: "http:bearer"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputAPIKey = { - type: "apiKey:header" | "apiKey:query" | "apiKey:cookie"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOIDC = { - type: "openIdConnect"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2 = { - type: "oauth2"; - value: string | null | undefined; - fieldName: string; -}; - -type SecurityInputOAuth2ClientCredentials = { - type: "oauth2:client_credentials"; - value: - | { - clientID?: string | undefined; - clientSecret?: string | undefined; - } - | null - | string - | undefined; - fieldName?: string; -}; - -type SecurityInputOAuth2PasswordCredentials = { - type: "oauth2:password"; - value: - | string - | null - | undefined; - fieldName?: string; -}; - -type SecurityInputCustom = { - type: "http:custom"; - value: any | null | undefined; - fieldName?: string; -}; - -export type SecurityInput = - | SecurityInputBasic - | SecurityInputBearer - | SecurityInputAPIKey - | SecurityInputOAuth2 - | SecurityInputOAuth2ClientCredentials - | SecurityInputOAuth2PasswordCredentials - | SecurityInputOIDC - | SecurityInputCustom; - -export function resolveSecurity( - ...options: SecurityInput[][] -): SecurityState | null { - const state: SecurityState = { - basic: {}, - headers: {}, - queryParams: {}, - cookies: {}, - oauth2: { type: "none" }, - }; - - const option = options.find((opts) => { - return opts.every((o) => { - if (o.value == null) { - return false; - } else if (o.type === "http:basic") { - return o.value.username != null || o.value.password != null; - } else if (o.type === "http:custom") { - return null; - } else if (o.type === "oauth2:password") { - return ( - typeof o.value === "string" && !!o.value - ); - } else if (o.type === "oauth2:client_credentials") { - if (typeof o.value == "string") { - return !!o.value; - } - return o.value.clientID != null || o.value.clientSecret != null; - } else if (typeof o.value === "string") { - return !!o.value; - } else { - throw new Error( - `Unrecognized security type: ${o.type} (value type: ${typeof o - .value})`, - ); - } - }); - }); - if (option == null) { - return null; - } - - option.forEach((spec) => { - if (spec.value == null) { - return; - } - - const { type } = spec; - - switch (type) { - case "apiKey:header": - state.headers[spec.fieldName] = spec.value; - break; - case "apiKey:query": - state.queryParams[spec.fieldName] = spec.value; - break; - case "apiKey:cookie": - state.cookies[spec.fieldName] = spec.value; - break; - case "http:basic": - applyBasic(state, spec); - break; - case "http:custom": - break; - case "http:bearer": - applyBearer(state, spec); - break; - case "oauth2": - applyBearer(state, spec); - break; - case "oauth2:password": - applyBearer(state, spec); - break; - case "oauth2:client_credentials": - break; - case "openIdConnect": - applyBearer(state, spec); - break; - default: - throw SecurityError.unrecognizedType((spec satisfies never, type)); - } - }); - - return state; -} - -function applyBasic( - state: SecurityState, - spec: SecurityInputBasic, -) { - if (spec.value == null) { - return; - } - - state.basic = spec.value; -} - -function applyBearer( - state: SecurityState, - spec: - | SecurityInputBearer - | SecurityInputOAuth2 - | SecurityInputOIDC - | SecurityInputOAuth2PasswordCredentials, -) { - if (typeof spec.value !== "string" || !spec.value) { - return; - } - - let value = spec.value; - if (value.slice(0, 7).toLowerCase() !== "bearer ") { - value = `Bearer ${value}`; - } - - if (spec.fieldName !== undefined) { - state.headers[spec.fieldName] = value; - } -} - -export function resolveGlobalSecurity( - security: Partial | null | undefined, - allowedFields?: number[], -): SecurityState | null { - let inputs: SecurityInput[][] = [ - [ - { - fieldName: "Authorization", - type: "apiKey:header", - value: security?.authHeader, - }, - ], - ]; - - if (allowedFields) { - inputs = allowedFields.map((i) => { - if (i < 0 || i >= inputs.length) { - throw new RangeError(`invalid allowedFields index ${i}`); - } - return inputs[i]!; - }); - } - - return resolveSecurity(...inputs); -} - -export async function extractSecurity< - T extends string | Record, ->(sec: T | (() => Promise) | undefined): Promise { - if (sec == null) { - return; - } - - return typeof sec === "function" ? sec() : sec; -} diff --git a/sync-for-expenses/src/lib/url.ts b/sync-for-expenses/src/lib/url.ts deleted file mode 100644 index 79e7ce660..000000000 --- a/sync-for-expenses/src/lib/url.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const hasOwn = Object.prototype.hasOwnProperty; - -export type Params = Partial>; - -export function pathToFunc( - pathPattern: string, - options?: { charEncoding?: "percent" | "none" }, -): (params?: Params) => string { - const paramRE = /\{([a-zA-Z0-9_][a-zA-Z0-9_-]*?)\}/g; - - return function buildURLPath(params: Record = {}): string { - return pathPattern - .replace(paramRE, function (_, placeholder) { - if (!hasOwn.call(params, placeholder)) { - throw new Error(`Parameter '${placeholder}' is required`); - } - - const value = params[placeholder]; - if (typeof value !== "string" && typeof value !== "number") { - throw new Error( - `Parameter '${placeholder}' must be a string or number`, - ); - } - - return options?.charEncoding === "percent" - ? encodeURIComponent(`${value}`) - : `${value}`; - }) - .replace(/^\/+/, ""); - }; -} diff --git a/sync-for-expenses/src/runtime.ts b/sync-for-expenses/src/runtime.ts new file mode 100644 index 000000000..a8972cf96 --- /dev/null +++ b/sync-for-expenses/src/runtime.ts @@ -0,0 +1,518 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +import { SDKError } from './sdk/models/errors/sdkerror'; +import { ErrorMessage } from './sdk/models/errors/errormessage'; +import type { RetryConfig } from './lib/sdkconfig'; + +export const BASE_PATH = "https://api.codat.io".replace(/\/+$/, ""); + +export type RequestOptions = { + timeoutMs?: number; + retries?: RetryConfig; + retryCodes?: string[]; + serverURL?: string | URL; + fetchOptions?: Omit; +} & Omit; + +export interface ConfigurationParameters { + basePath?: string; // override base path + fetchApi?: FetchAPI; // override for fetch implementation + middleware?: Middleware[]; // middleware to apply before/after fetch requests + queryParamsStringify?: (params: HTTPQuery) => string; // stringify function for query strings + username?: string; // parameter for basic security + password?: string; // parameter for basic security + apiKey?: string | Promise | ((name: string) => string | Promise); // parameter for apiKey security + accessToken?: string | Promise | ((name?: string, scopes?: string[]) => string | Promise); // parameter for oauth2 security + headers?: HTTPHeaders; //header params we want to use on every request + credentials?: RequestCredentials; //value for the credentials param we want to use on each request +} + +export class Configuration { + constructor(private configuration: ConfigurationParameters = {}) {} + + set config(configuration: Configuration) { + this.configuration = configuration; + } + + get basePath(): string { + return this.configuration.basePath != null ? this.configuration.basePath : BASE_PATH; + } + + get fetchApi(): FetchAPI | undefined { + return this.configuration.fetchApi; + } + + get middleware(): Middleware[] { + return this.configuration.middleware || []; + } + + get queryParamsStringify(): (params: HTTPQuery) => string { + return this.configuration.queryParamsStringify || querystring; + } + + get username(): string | undefined { + return this.configuration.username; + } + + get password(): string | undefined { + return this.configuration.password; + } + + get apiKey(): ((name: string) => string | Promise) | undefined { + const apiKey = this.configuration.apiKey; + if (apiKey) { + return typeof apiKey === 'function' ? apiKey : () => apiKey; + } + return undefined; + } + + get accessToken(): ((name?: string, scopes?: string[]) => string | Promise) | undefined { + const accessToken = this.configuration.accessToken; + if (accessToken) { + return typeof accessToken === 'function' ? accessToken : async () => accessToken; + } + return undefined; + } + + get headers(): HTTPHeaders | undefined { + return this.configuration.headers; + } + + get credentials(): RequestCredentials | undefined { + return this.configuration.credentials; + } +} + +export const DefaultConfig = new Configuration(); + +/** + * This is the base class for all generated API classes. + */ +export class BaseAPI { + + private static readonly jsonRegex = new RegExp('^(:?application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(:?;.*)?$', 'i'); + private middleware: Middleware[]; + + constructor(protected configuration = DefaultConfig) { + this.middleware = configuration.middleware; + } + + withMiddleware(this: T, ...middlewares: Middleware[]) { + const next = this.clone(); + next.middleware = next.middleware.concat(...middlewares); + return next; + } + + withPreMiddleware(this: T, ...preMiddlewares: Array) { + const middlewares = preMiddlewares.map((pre) => ({ pre })); + return this.withMiddleware(...middlewares); + } + + withPostMiddleware(this: T, ...postMiddlewares: Array) { + const middlewares = postMiddlewares.map((post) => ({ post })); + return this.withMiddleware(...middlewares); + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * @param mime - MIME (Multipurpose Internet Mail Extensions) + * @return True if the given MIME is JSON, false otherwise. + */ + protected isJsonMime(mime: string | null | undefined): boolean { + if (!mime) { + return false; + } + return BaseAPI.jsonRegex.test(mime); + } + + protected async request(context: RequestOpts, options?: RequestOptions): Promise { + const { url, init } = await this.createFetchParams(context, options); + const response = await this.fetchApi(url, init); + if (response && (response.status >= 200 && response.status < 300)) { + return response; + } + throw await buildSpeakeasyError(url, init, response, context.errorStatuses); + } + + private async createFetchParams(context: RequestOpts, options?: RequestOptions) { + const opts: RequestOptions = options ?? {}; + const { + timeoutMs, + retries, + retryCodes, + serverURL, + fetchOptions, + headers: perCallHeaders, + ...restInit + } = opts; + + const base = (typeof serverURL === "string" || serverURL instanceof URL) + ? String(serverURL).replace(/\/+$/, "") + : this.configuration.basePath; + let url = base + context.path; + if (context.query !== undefined && Object.keys(context.query).length !== 0) { + url += '?' + this.configuration.queryParamsStringify(context.query); + } + + const headers = Object.assign( + {}, + this.configuration.headers, + context.headers, + toHeaderRecord(fetchOptions?.headers), + toHeaderRecord(perCallHeaders), + ); + Object.keys(headers).forEach(key => headers[key] === undefined ? delete headers[key] : {}); + + let body: any; + if (isFormData(context.body) + || (context.body instanceof URLSearchParams) + || isBlob(context.body)) { + body = context.body; + } else if (this.isJsonMime(headers['Content-Type'])) { + body = JSON.stringify(context.body); + } else { + body = context.body; + } + + const init: RequestInit = { + ...fetchOptions, + ...restInit, + method: context.method, + headers, + body, + }; + if (init.credentials === undefined && this.configuration.credentials !== undefined) { + init.credentials = this.configuration.credentials; + } + if (!init.signal && timeoutMs && timeoutMs > 0) { + init.signal = AbortSignal.timeout(timeoutMs); + } + + const stamped = init as RequestInit & { + __codatOperationId?: string; + __codatRetries?: RetryConfig; + __codatRetryCodes?: string[]; + }; + if (context.operationId !== undefined) { + stamped.__codatOperationId = context.operationId; + } + if (retries !== undefined) { + stamped.__codatRetries = retries; + } + if (retryCodes !== undefined) { + stamped.__codatRetryCodes = retryCodes; + } + + return { url, init }; + } + + private fetchApi = async (url: string, init: RequestInit) => { + let fetchParams = { url, init }; + for (const middleware of this.middleware) { + if (middleware.pre) { + fetchParams = await middleware.pre({ + fetch: this.fetchApi, + ...fetchParams, + }) || fetchParams; + } + } + let response: Response | undefined = undefined; + try { + response = await (this.configuration.fetchApi || fetch)(fetchParams.url, fetchParams.init); + } catch (e) { + for (const middleware of this.middleware) { + if (middleware.onError) { + response = await middleware.onError({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + error: e, + response: response ? response.clone() : undefined, + }) || response; + } + } + if (response === undefined) { + if (e instanceof Error) { + throw new FetchError(e, 'The request failed and the interceptors did not return an alternative response'); + } else { + throw e; + } + } + } + for (const middleware of this.middleware) { + if (middleware.post) { + response = await middleware.post({ + fetch: this.fetchApi, + url: fetchParams.url, + init: fetchParams.init, + response: response.clone(), + }) || response; + } + } + return response; + } + + /** + * Create a shallow clone of `this` by constructing a new instance + * and then shallow cloning data members. + */ + private clone(this: T): T { + const constructor = this.constructor as any; + const next = new constructor(this.configuration); + next.middleware = this.middleware.slice(); + return next; + } +}; + +function isBlob(value: any): value is Blob { + return typeof Blob !== 'undefined' && value instanceof Blob; +} + +function isFormData(value: any): value is FormData { + return typeof FormData !== "undefined" && value instanceof FormData; +} + +function toHeaderRecord(headers: HeadersInit | undefined): HTTPHeaders { + if (!headers) { + return {}; + } + if (typeof Headers !== "undefined" && headers instanceof Headers) { + const out: HTTPHeaders = {}; + headers.forEach((value, key) => { out[key] = value; }); + return out; + } + if (Array.isArray(headers)) { + const out: HTTPHeaders = {}; + for (const [key, value] of headers) { + out[key] = value; + } + return out; + } + return { ...(headers as Record) }; +} + +export class ResponseError extends Error { + override name: "ResponseError" = "ResponseError"; + constructor(public response: Response, msg?: string) { + super(msg); + } +} + +async function buildSpeakeasyError(url: string, init: RequestInit, response: Response, errorStatuses?: number[]): Promise { + const httpResponse = response ?? new Response(null, { status: 500 }); + const body = response ? await response.clone().text() : ""; + const httpMeta = { response: httpResponse, request: new Request(url, { method: init.method }), body }; + let data: any; + try { + data = body ? JSON.parse(body) : undefined; + } catch { + data = undefined; + } + const documentsThisStatus = Array.isArray(errorStatuses) && errorStatuses.indexOf(httpResponse.status) !== -1; + if (documentsThisStatus && data && typeof data === "object" && !Array.isArray(data)) { + return new ErrorMessage(data, httpMeta); + } + return new SDKError("Response returned an error code", httpMeta); +} + +export class FetchError extends Error { + override name: "FetchError" = "FetchError"; + constructor(public cause: Error, msg?: string) { + super(msg); + } +} + +export class RequiredError extends Error { + override name: "RequiredError" = "RequiredError"; + constructor(public field: string, msg?: string) { + super(msg); + } +} + +export const COLLECTION_FORMATS = { + csv: ",", + ssv: " ", + tsv: "\t", + pipes: "|", +}; + +export type FetchAPI = WindowOrWorkerGlobalScope['fetch']; + +export type Json = any; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; +export type HTTPHeaders = { [key: string]: string }; +export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | Set | HTTPQuery }; +export type HTTPBody = Json | FormData | URLSearchParams; +export type HTTPRequestInit = { headers?: HTTPHeaders; method: HTTPMethod; credentials?: RequestCredentials; body?: HTTPBody }; +export type ModelPropertyNaming = 'camelCase' | 'snake_case' | 'PascalCase' | 'original'; + +export type InitOverrideFunction = (requestContext: { init: HTTPRequestInit, context: RequestOpts }) => Promise + +export interface FetchParams { + url: string; + init: RequestInit; +} + +export interface RequestOpts { + path: string; + method: HTTPMethod; + operationId?: string; + errorStatuses?: number[]; + headers: HTTPHeaders; + query?: HTTPQuery; + body?: HTTPBody; +} + +export function querystring(params: HTTPQuery, prefix: string = ''): string { + return Object.keys(params) + .map(key => querystringSingleKey(key, params[key], prefix)) + .filter(part => part.length > 0) + .join('&'); +} + +function querystringSingleKey(key: string, value: string | number | null | undefined | boolean | Array | Set | HTTPQuery, keyPrefix: string = ''): string { + const fullKey = keyPrefix + (keyPrefix.length ? `[${key}]` : key); + if (value instanceof Array) { + const multiValue = value.map(singleValue => encodeURIComponent(String(singleValue))) + .join(`&${encodeURIComponent(fullKey)}=`); + return `${encodeURIComponent(fullKey)}=${multiValue}`; + } + if (value instanceof Set) { + const valueAsArray = Array.from(value); + return querystringSingleKey(key, valueAsArray, keyPrefix); + } + if (value instanceof Date) { + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(value.toISOString())}`; + } + if (value instanceof Object) { + return querystring(value as HTTPQuery, fullKey); + } + return `${encodeURIComponent(fullKey)}=${encodeURIComponent(String(value))}`; +} + +export function exists(json: any, key: string) { + const value = json[key]; + return value !== null && value !== undefined; +} + +export function mapValues(data: any, fn: (item: any) => any) { + return Object.keys(data).reduce( + (acc, key) => ({ ...acc, [key]: fn(data[key]) }), + {} + ); +} + +export function canConsumeForm(consumes: Consume[]): boolean { + for (const consume of consumes) { + if ('multipart/form-data' === consume.contentType) { + return true; + } + } + return false; +} + +export interface Consume { + contentType: string; +} + +export interface RequestContext { + fetch: FetchAPI; + url: string; + init: RequestInit; +} + +export interface ResponseContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + response: Response; +} + +export interface ErrorContext { + fetch: FetchAPI; + url: string; + init: RequestInit; + error: unknown; + response?: Response; +} + +export interface Middleware { + pre?(context: RequestContext): Promise; + post?(context: ResponseContext): Promise; + onError?(context: ErrorContext): Promise; +} + +export interface ApiResponse { + raw: Response; + value(): Promise; +} + +export interface ResponseTransformer { + (json: any): T; +} + +export class JSONApiResponse { + constructor(public raw: Response, private transformer: ResponseTransformer = (jsonValue: any) => jsonValue) {} + + async value(): Promise { + return this.transformer(await this.raw.json()); + } +} + +export class VoidApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return undefined; + } +} + +export class BlobApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.blob(); + }; +} + +export class TextApiResponse { + constructor(public raw: Response) {} + + async value(): Promise { + return await this.raw.text(); + }; +} + + +import { Decimal } from './sdk/types/decimal'; +export { Decimal }; + +export function toDecimal(value: any): any { + if (value == null) { return value; } + if (Array.isArray(value)) { return value.map(toDecimal); } + return value instanceof Decimal ? value : new Decimal(value); +} + +export function fromDecimal(value: any): any { + if (value == null) { return value; } + if (Array.isArray(value)) { return value.map(fromDecimal); } + return value instanceof Decimal ? value.toNumber() : value; +} diff --git a/sync-for-expenses/src/sdk.ts b/sync-for-expenses/src/sdk.ts new file mode 100644 index 000000000..86e3ccd4d --- /dev/null +++ b/sync-for-expenses/src/sdk.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +import { Configuration as SDKConfiguration, ConfigurationParameters } from './runtime'; +import type * as shared from './sdk/models/index'; +import { SDKOptions, resolveServerURL, resolveAuthHeader, resolveUserAgent, makeFetch, HTTPClient } from './lib/sdkconfig'; +import { SDKHooks } from './hooks/hooks'; +import { validateWebhook as runValidateWebhook } from './funcs/validateWebhook'; +import { + Accounts, + Adjustments, + Attachments, + BankAccounts, + Companies, + CompanyInfo, + Configuration, + Connections, + Customers, + Expenses, + ManageData, + MappingOptions, + PushOperations, + Reimbursements, + Suppliers, + Sync, + TransactionStatus, + Transfers, +} from './apis/index'; + +export class CodatSyncExpenses { + private readonly _config: SDKConfiguration; + + constructor(options: SDKOptions | ConfigurationParameters | SDKConfiguration = {}) { + if (options instanceof SDKConfiguration) { + this._config = options; + return; + } + const opts = options as SDKOptions & ConfigurationParameters; + const hooks = new SDKHooks(); + const baseURL = opts.basePath ?? resolveServerURL(opts); + let parsedBaseURL: URL | null = null; + try { parsedBaseURL = new URL(baseURL); } catch { parsedBaseURL = null; } + const init = hooks.sdkInit({ baseURL: parsedBaseURL, client: opts.httpClient ?? new HTTPClient() }); + const resolvedBaseURL = init.baseURL ? init.baseURL.toString().replace(/\/+$/, '') : baseURL; + this._config = new SDKConfiguration({ + ...opts, + basePath: resolvedBaseURL, + apiKey: opts.apiKey ?? resolveAuthHeader(opts.authHeader), + fetchApi: opts.fetchApi ?? makeFetch({ ...opts, httpClient: init.client }, hooks), + headers: { ...(opts.headers ?? {}), ...resolveUserAgent(opts.userAgent) }, + }); + } + + private _accounts?: Accounts; + get accounts(): Accounts { + if (!this._accounts) { this._accounts = new Accounts(this._config); } + return this._accounts; + } + + private _adjustments?: Adjustments; + get adjustments(): Adjustments { + if (!this._adjustments) { this._adjustments = new Adjustments(this._config); } + return this._adjustments; + } + + private _attachments?: Attachments; + get attachments(): Attachments { + if (!this._attachments) { this._attachments = new Attachments(this._config); } + return this._attachments; + } + + private _bankAccounts?: BankAccounts; + get bankAccounts(): BankAccounts { + if (!this._bankAccounts) { this._bankAccounts = new BankAccounts(this._config); } + return this._bankAccounts; + } + + private _companies?: Companies; + get companies(): Companies { + if (!this._companies) { this._companies = new Companies(this._config); } + return this._companies; + } + + private _companyInfo?: CompanyInfo; + get companyInfo(): CompanyInfo { + if (!this._companyInfo) { this._companyInfo = new CompanyInfo(this._config); } + return this._companyInfo; + } + + private _configuration?: Configuration; + get configuration(): Configuration { + if (!this._configuration) { this._configuration = new Configuration(this._config); } + return this._configuration; + } + + private _connections?: Connections; + get connections(): Connections { + if (!this._connections) { this._connections = new Connections(this._config); } + return this._connections; + } + + private _customers?: Customers; + get customers(): Customers { + if (!this._customers) { this._customers = new Customers(this._config); } + return this._customers; + } + + private _expenses?: Expenses; + get expenses(): Expenses { + if (!this._expenses) { this._expenses = new Expenses(this._config); } + return this._expenses; + } + + private _manageData?: ManageData; + get manageData(): ManageData { + if (!this._manageData) { this._manageData = new ManageData(this._config); } + return this._manageData; + } + + private _mappingOptions?: MappingOptions; + get mappingOptions(): MappingOptions { + if (!this._mappingOptions) { this._mappingOptions = new MappingOptions(this._config); } + return this._mappingOptions; + } + + private _pushOperations?: PushOperations; + get pushOperations(): PushOperations { + if (!this._pushOperations) { this._pushOperations = new PushOperations(this._config); } + return this._pushOperations; + } + + private _reimbursements?: Reimbursements; + get reimbursements(): Reimbursements { + if (!this._reimbursements) { this._reimbursements = new Reimbursements(this._config); } + return this._reimbursements; + } + + private _suppliers?: Suppliers; + get suppliers(): Suppliers { + if (!this._suppliers) { this._suppliers = new Suppliers(this._config); } + return this._suppliers; + } + + private _sync?: Sync; + get sync(): Sync { + if (!this._sync) { this._sync = new Sync(this._config); } + return this._sync; + } + + private _transactionStatus?: TransactionStatus; + get transactionStatus(): TransactionStatus { + if (!this._transactionStatus) { this._transactionStatus = new TransactionStatus(this._config); } + return this._transactionStatus; + } + + private _transfers?: Transfers; + get transfers(): Transfers { + if (!this._transfers) { this._transfers = new Transfers(this._config); } + return this._transfers; + } + + async validateWebhook(args: { request: { body: string; headers: Record | Headers; url: string; method: string; } | Request; }): Promise { + const outcome = await runValidateWebhook(this as never, { request: args.request }); + if (!outcome.ok) { throw outcome.error; } + return outcome.value; + } +} diff --git a/sync-for-expenses/src/sdk/accounts.ts b/sync-for-expenses/src/sdk/accounts.ts index 32022dc48..437d28479 100644 --- a/sync-for-expenses/src/sdk/accounts.ts +++ b/sync-for-expenses/src/sdk/accounts.ts @@ -1,58 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { accountsCreate } from "../funcs/accountsCreate.js"; -import { accountsGetCreateModel } from "../funcs/accountsGetCreateModel.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Accounts extends ClientSDK { - /** - * Create account - * - * @remarks - * The *Create account* endpoint creates a new [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company's connection. - * - * [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). - */ - async create( - request: operations.CreateAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(accountsCreate( - this, - request, - options, - )); - } - - /** - * Get create account model - * - * @remarks - * The *Get create account model* endpoint returns the expected data for the request payload when creating an [account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) for a given company and integration. - * - * [Accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) are the categories a business uses to record accounting transactions. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ - async getCreateModel( - request: operations.GetCreateChartOfAccountsModelRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(accountsGetCreateModel( - this, - request, - options, - )); - } -} +export { Accounts } from "../apis/Accounts"; diff --git a/sync-for-expenses/src/sdk/adjustments.ts b/sync-for-expenses/src/sdk/adjustments.ts index ae4f7fb31..8328e245a 100644 --- a/sync-for-expenses/src/sdk/adjustments.ts +++ b/sync-for-expenses/src/sdk/adjustments.ts @@ -1,36 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { adjustmentsCreate } from "../funcs/adjustmentsCreate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Adjustments extends ClientSDK { - /** - * Create adjustment transaction - * - * @remarks - * Use the *Create adjustment expense* endpoint to create an [adjustment](https://docs.codat.io/sync-for-expenses-api#/schemas/AdjustmentTransactionRequest) in the accounting software for a given company's connection. - * - * Adjustments represent write-offs and transaction alterations, such as foreign exchange adjustments, in the form of a journal entry. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-----------------------|-----------| - * | QuickBooks Desktop | Yes | - */ - async create( - request: operations.CreateAdjustmentTransactionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(adjustmentsCreate( - this, - request, - options, - )); - } -} +export { Adjustments } from "../apis/Adjustments"; diff --git a/sync-for-expenses/src/sdk/attachments.ts b/sync-for-expenses/src/sdk/attachments.ts index 8b35460c9..2d421faf8 100644 --- a/sync-for-expenses/src/sdk/attachments.ts +++ b/sync-for-expenses/src/sdk/attachments.ts @@ -1,44 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { attachmentsUpload } from "../funcs/attachmentsUpload.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Attachments extends ClientSDK { - /** - * Upload attachment - * - * @remarks - * The *Upload attachment* endpoint uploads an attachment in the accounting software against the given transactionId. - * - * [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. Attachments for `Adjustment` and `Transfer` transaction types are not supported for any integrations. - * - * **Integration-specific behavior** - * - * Each accounting software supports different file formats and sizes. - * - * | Integration | File size | File extension | Supported transactions | - * |-----------------------------------|-----------|-------------------------------------------------------|------------------------| - * | **Xero** | 3 MB | 7Z, BMP, CSV, DOC, DOCX, EML, GIF, JPEG, JPG, KEYNOTE, MSG, NUMBERS, ODF, ODS, ODT, PAGES, PDF, PNG, PPT, PPTX, RAR, RTF, TIF, TIFF, TXT, XLS, XLSX, ZIP | All supported types | - * | **QuickBooks Online** | 100 MB | AI, CSV, DOC, DOCX, EPS, GIF, JPEG, JPG, ODS, PAGES, PDF, PNG, RTF, TIF, TXT, XLS, XLSX, XML | `expense-transactions.Payment`, `expense-transactions.Refund`, `reimbursable-expense-transactions` | - * | **NetSuite** | 100 MB | BMP, CSV, XLS, XLSX, JSON, PDF, PJPG, PJPEG, PNG, TXT, SVG, TIF, TIFF, DOC, DOCX, ZIP |`expense-transactions.Payment`, `expense-transactions.Refund` | - * | **Dynamics 365 Business Central** | 350 MB | [No explicit requirements outlined](https://learn.microsoft.com/en-gb/dynamics365/business-central/ui-how-add-link-to-record#to-attach-a-file-to-a-purchase-invoice) for text, image, and video files. | All supported types - * | **QuickBooks Desktop** | NA | Does not support attachment upload | N/A | - * | **FreeAgent** | 5MB | PNG, X-PNG, JPEG, PJG, GIF, X-PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` - * | **Zoho Books** | 5MB | GIF, PNG, JPEG, JPG, BMP, PDF | `expense-transactions.Payment`, `reimbursable-expense-transactions` | - */ - async upload( - request: operations.UploadExpenseAttachmentRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(attachmentsUpload( - this, - request, - options, - )); - } -} +export { Attachments } from "../apis/Attachments"; diff --git a/sync-for-expenses/src/sdk/bankaccounts.ts b/sync-for-expenses/src/sdk/bankaccounts.ts index 0babfd4c2..911d7ba40 100644 --- a/sync-for-expenses/src/sdk/bankaccounts.ts +++ b/sync-for-expenses/src/sdk/bankaccounts.ts @@ -1,58 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { bankAccountsCreate } from "../funcs/bankAccountsCreate.js"; -import { bankAccountsGetCreateModel } from "../funcs/bankAccountsGetCreateModel.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class BankAccounts extends ClientSDK { - /** - * Create bank account - * - * @remarks - * The *Create bank account* endpoint creates a new [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company's connection. - * - * [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update bank account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-bankAccounts-model). - */ - async create( - request: operations.CreateBankAccountRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(bankAccountsCreate( - this, - request, - options, - )); - } - - /** - * Get create bank account model - * - * @remarks - * The *Get create/update bank account model* endpoint returns the expected data for the request payload when creating and updating a [bank account](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) for a given company and integration. - * - * [Bank accounts](https://docs.codat.io/sync-for-expenses-api#/schemas/BankAccount) are financial accounts maintained by a bank or other financial institution. - * - * **Integration-specific behavior** - * - * See the *response examples* for integration-specific indicative models. - */ - async getCreateModel( - request: operations.GetCreateBankAccountsModelRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(bankAccountsGetCreateModel( - this, - request, - options, - )); - } -} +export { BankAccounts } from "../apis/BankAccounts"; diff --git a/sync-for-expenses/src/sdk/companies.ts b/sync-for-expenses/src/sdk/companies.ts index 12e5f3369..4b89b1e24 100644 --- a/sync-for-expenses/src/sdk/companies.ts +++ b/sync-for-expenses/src/sdk/companies.ts @@ -1,152 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companiesCreate } from "../funcs/companiesCreate.js"; -import { companiesDelete } from "../funcs/companiesDelete.js"; -import { companiesGet } from "../funcs/companiesGet.js"; -import { companiesList } from "../funcs/companiesList.js"; -import { companiesReplace } from "../funcs/companiesReplace.js"; -import { companiesUpdate } from "../funcs/companiesUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Companies extends ClientSDK { - /** - * List companies - * - * @remarks - * The *List companies* endpoint returns a list of [companies](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) associated to your instances. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - * - * ## Filter by tags - * - * The *List companies* endpoint supports the filtering of companies using [tags](https://docs.codat.io/using-the-api/managing-companies#add-metadata-to-a-company). It supports the following operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying): - * - * - equals (`=`) - * - not equals (`!=`) - * - contains (`~`) - * - * For example, you can use the querying to filter companies tagged with a specific foreign key, region, or owning team: - * - Foreign key: `uid = {yourCustomerId}` - * - Region: `region != uk` - * - Owning team and region: `region = uk && owningTeam = invoice-finance` - */ - async list( - request?: operations.ListCompaniesRequest | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesList( - this, - request, - options, - )); - } - - /** - * Create company - * - * @remarks - * Use the *Create company* endpoint to create a new [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) that represents your customer in Codat. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources, such as one connection to Xero for accounting data, two connections to Plaid for two bank accounts, and a connection to Zettle for POS data. - * - * If forbidden characters (see `name` pattern) are present in the request, a company will be created with the forbidden characters removed. For example, `Company (Codat[1])` with be created as `Company Codat1`. - */ - async create( - request?: shared.CompanyRequestBody | undefined, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesCreate( - this, - request, - options, - )); - } - - /** - * Replace company - * - * @remarks - * Use the *Replace company* endpoint to replace the existing name, description, and tags of the company. Calling the endpoint will replace existing values even if new values haven't been defined in the payload. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - */ - async replace( - request: operations.ReplaceCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesReplace( - this, - request, - options, - )); - } - - /** - * Update company - * - * @remarks - * Use the *Update company* endpoint to update the name, description, or tags of the company. - * - * The *Update company* endpoint doesn't have any required fields. If any of the fields provided are `null` or not provided, they won't be included in the update. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - */ - async update( - request: operations.UpdateCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesUpdate( - this, - request, - options, - )); - } - - /** - * Delete a company - * - * @remarks - * The *Delete company* endpoint permanently deletes a [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company), its [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) and any cached data. This operation is irreversible. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - */ - async delete( - request: operations.DeleteCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesDelete( - this, - request, - options, - )); - } - - /** - * Get company - * - * @remarks - * The *Get company* endpoint returns a single company for a given `companyId`. - * - * A [company](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) represents a business sharing access to their data. - * Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - */ - async get( - request: operations.GetCompanyRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companiesGet( - this, - request, - options, - )); - } -} +export { Companies } from "../apis/Companies"; diff --git a/sync-for-expenses/src/sdk/companyinfo.ts b/sync-for-expenses/src/sdk/companyinfo.ts index 5c63a705d..d8ecf2281 100644 --- a/sync-for-expenses/src/sdk/companyinfo.ts +++ b/sync-for-expenses/src/sdk/companyinfo.ts @@ -1,28 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { companyInfoGet } from "../funcs/companyInfoGet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CompanyInfo extends ClientSDK { - /** - * Get company info - * - * @remarks - * Gets the latest basic info for a company. - */ - async get( - request: operations.GetCompanyInfoRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(companyInfoGet( - this, - request, - options, - )); - } -} +export { CompanyInfo } from "../apis/CompanyInfo"; diff --git a/sync-for-expenses/src/sdk/configuration.ts b/sync-for-expenses/src/sdk/configuration.ts index ba3773971..f3bdcb23e 100644 --- a/sync-for-expenses/src/sdk/configuration.ts +++ b/sync-for-expenses/src/sdk/configuration.ts @@ -1,46 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { configurationGet } from "../funcs/configurationGet.js"; -import { configurationSet } from "../funcs/configurationSet.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Configuration extends ClientSDK { - /** - * Get company configuration - * - * @remarks - * Gets a company's expense sync configuration - */ - async get( - request: operations.GetCompanyConfigurationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(configurationGet( - this, - request, - options, - )); - } - - /** - * Set company configuration - * - * @remarks - * Sets a company's expense sync configuration - */ - async set( - request: operations.SetCompanyConfigurationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(configurationSet( - this, - request, - options, - )); - } -} +export { Configuration } from "../apis/Configuration"; diff --git a/sync-for-expenses/src/sdk/connections.ts b/sync-for-expenses/src/sdk/connections.ts index b028cd9e7..9abd92e59 100644 --- a/sync-for-expenses/src/sdk/connections.ts +++ b/sync-for-expenses/src/sdk/connections.ts @@ -1,121 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { connectionsCreate } from "../funcs/connectionsCreate.js"; -import { connectionsCreatePartnerExpenseConnection } from "../funcs/connectionsCreatePartnerExpenseConnection.js"; -import { connectionsDelete } from "../funcs/connectionsDelete.js"; -import { connectionsGet } from "../funcs/connectionsGet.js"; -import { connectionsList } from "../funcs/connectionsList.js"; -import { connectionsUnlink } from "../funcs/connectionsUnlink.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Connections extends ClientSDK { - /** - * List connections - * - * @remarks - * List the connections for a company. - */ - async list( - request: operations.ListConnectionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsList( - this, - request, - options, - )); - } - - /** - * Create connection - * - * @remarks - * Creates a connection for the company by providing a valid `platformKey`. - * - * Use the [List Integrations](https://docs.codat.io/platform-api#/operations/list-integrations) endpoint to access valid platform keys. - */ - async create( - request: operations.CreateConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsCreate( - this, - request, - options, - )); - } - - /** - * Get connection - * - * @remarks - * 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. - */ - async get( - request: operations.GetConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsGet( - this, - request, - options, - )); - } - - /** - * Delete connection - * - * @remarks - * 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. - */ - async delete( - request: operations.DeleteConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsDelete( - this, - request, - options, - )); - } - - /** - * Unlink connection - * - * @remarks - * 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. - */ - async unlink( - request: operations.UnlinkConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsUnlink( - this, - request, - options, - )); - } - - /** - * Create partner expense connection - * - * @remarks - * Creates a partner expense data connection - */ - async createPartnerExpenseConnection( - request: operations.CreatePartnerExpenseConnectionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(connectionsCreatePartnerExpenseConnection( - this, - request, - options, - )); - } -} +export { Connections } from "../apis/Connections"; diff --git a/sync-for-expenses/src/sdk/customers.ts b/sync-for-expenses/src/sdk/customers.ts index ca4606be6..354c7d1e5 100644 --- a/sync-for-expenses/src/sdk/customers.ts +++ b/sync-for-expenses/src/sdk/customers.ts @@ -1,102 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { customersCreate } from "../funcs/customersCreate.js"; -import { customersGet } from "../funcs/customersGet.js"; -import { customersList } from "../funcs/customersList.js"; -import { customersUpdate } from "../funcs/customersUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Customers extends ClientSDK { - /** - * List customers - * - * @remarks - * The *List customers* endpoint returns a list of [customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - */ - async list( - request: operations.ListCustomersRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customersList( - this, - request, - options, - )); - } - - /** - * Get customer - * - * @remarks - * The *Get customer* endpoint returns a single customer for a given customerId. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-company-data). - */ - async get( - request: operations.GetCustomerRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customersGet( - this, - request, - options, - )); - } - - /** - * Create customer - * - * @remarks - * The *Create customer* endpoint creates a new [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - */ - async create( - request: operations.CreateCustomerRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customersCreate( - this, - request, - options, - )); - } - - /** - * Update customer - * - * @remarks - * The *Update customer* endpoint updates an existing [customer](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) for a given company's connection. - * - * [Customers](https://docs.codat.io/sync-for-expenses-api#/schemas/Customer) are people or organizations that buy goods or services from the SMB. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update customer model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-customers-model). - */ - async update( - request: operations.UpdateCustomerRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(customersUpdate( - this, - request, - options, - )); - } -} +export { Customers } from "../apis/Customers"; diff --git a/sync-for-expenses/src/sdk/expenses.ts b/sync-for-expenses/src/sdk/expenses.ts index 96497a4af..37c4531ac 100644 --- a/sync-for-expenses/src/sdk/expenses.ts +++ b/sync-for-expenses/src/sdk/expenses.ts @@ -1,81 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { expensesCreate } from "../funcs/expensesCreate.js"; -import { expensesUpdate } from "../funcs/expensesUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Expenses extends ClientSDK { - /** - * Create expense transaction - * - * @remarks - * The *Create expense* endpoint creates an [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) in the accounting software for a given company's connection. - * - * [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/ExpenseTransaction) represent transactions made with a company debit or credit card. - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ - async create( - request: operations.CreateExpenseTransactionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(expensesCreate( - this, - request, - options, - )); - } - - /** - * Update expense transactions - * - * @remarks - * The *Update expense* endpoint updates an existing [expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) in the accounting software for a given company's connection. - * - * [Expense transactions](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateExpenseRequest) represent transactions made with a company debit or credit card. - * - * ### Supported integrations - * The following integrations are supported for the [Payment](https://docs.codat.io/expenses/sync-process/expense-transactions#transaction-types) transaction `type` only: - * | Integration | Supported | - * |-----------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - * - * #### Integration-specific behavior - * - * | Integration | Specifics | - * |-----------------------|-----------| - * | Sage Intacct | To sync **debit card expenses**, map the debit card to a Credit Card with the account type set to `Debit`.| - */ - async update( - request: operations.UpdateExpenseTransactionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(expensesUpdate( - this, - request, - options, - )); - } -} +export { Expenses } from "../apis/Expenses"; diff --git a/sync-for-expenses/src/sdk/index.ts b/sync-for-expenses/src/sdk/index.ts index ecac22648..d28eeda9d 100644 --- a/sync-for-expenses/src/sdk/index.ts +++ b/sync-for-expenses/src/sdk/index.ts @@ -1,5 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export * from "./sdk.js"; +export * from "./sdk"; diff --git a/sync-for-expenses/src/sdk/managedata.ts b/sync-for-expenses/src/sdk/managedata.ts index abc8b7a38..98026248d 100644 --- a/sync-for-expenses/src/sdk/managedata.ts +++ b/sync-for-expenses/src/sdk/managedata.ts @@ -1,106 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { manageDataGet } from "../funcs/manageDataGet.js"; -import { manageDataGetPullOperation } from "../funcs/manageDataGetPullOperation.js"; -import { manageDataListPullOperations } from "../funcs/manageDataListPullOperations.js"; -import { manageDataRefreshAllDataTypes } from "../funcs/manageDataRefreshAllDataTypes.js"; -import { manageDataRefreshDataType } from "../funcs/manageDataRefreshDataType.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class ManageData extends ClientSDK { - /** - * Refresh all data - * - * @remarks - * Refreshes all data types with `fetch on first link` set to `true` for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - * - * [Read more](https://docs.codat.io/core-concepts/data-type-settings) about data type settings and `fetch on first link`. - */ - async refreshAllDataTypes( - request: operations.RefreshAllDataTypesRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(manageDataRefreshAllDataTypes( - this, - request, - options, - )); - } - - /** - * Get data status - * - * @remarks - * Get the state of each data type for a company - */ - async get( - request: operations.GetDataStatusRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(manageDataGet( - this, - request, - options, - )); - } - - /** - * Refresh data type - * - * @remarks - * Refreshes a given data type for a given company. - * - * This is an asynchronous operation, and will bring updated data into Codat from the linked integration for you to view. - */ - async refreshDataType( - request: operations.RefreshDataTypeRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(manageDataRefreshDataType( - this, - request, - options, - )); - } - - /** - * List pull operations - * - * @remarks - * Gets the pull operation history (datasets) for a given company. - */ - async listPullOperations( - request: operations.ListPullOperationsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(manageDataListPullOperations( - this, - request, - options, - )); - } - - /** - * Get pull operation - * - * @remarks - * Retrieve information about a single dataset or pull operation. - */ - async getPullOperation( - request: operations.GetPullOperationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(manageDataGetPullOperation( - this, - request, - options, - )); - } -} +export { ManageData } from "../apis/ManageData"; diff --git a/sync-for-expenses/src/sdk/mappingoptions.ts b/sync-for-expenses/src/sdk/mappingoptions.ts index ece14c6cf..c43c200bd 100644 --- a/sync-for-expenses/src/sdk/mappingoptions.ts +++ b/sync-for-expenses/src/sdk/mappingoptions.ts @@ -1,28 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { mappingOptionsGetMappingOptions } from "../funcs/mappingOptionsGetMappingOptions.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class MappingOptions extends ClientSDK { - /** - * Mapping options - * - * @remarks - * Gets the mapping options (accounts, trackingCategories and taxRates) for a company's accounting software - */ - async getMappingOptions( - request: operations.GetMappingOptionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(mappingOptionsGetMappingOptions( - this, - request, - options, - )); - } -} +export { MappingOptions } from "../apis/MappingOptions"; diff --git a/sync-for-expenses/src/sdk/models/Account.ts b/sync-for-expenses/src/sdk/models/Account.ts new file mode 100644 index 000000000..0be1abae8 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/Account.ts @@ -0,0 +1,1020 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { CreateAccountResponseMetadata } from './shared/metadata'; +import type { CreateAccountResponseValidDataTypeLinks } from './shared/validdatatypelinks'; +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { AccountStatus } from './shared/accountstatus'; +import { + AccountStatusFromJSON, + AccountStatusFromJSONTyped, + AccountStatusToJSON, + AccountStatusToJSONTyped, +} from './shared/accountstatus'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { ValidDataTypeLinks } from './shared/validdatatypelinks'; +import { + ValidDataTypeLinksFromJSON, + ValidDataTypeLinksFromJSONTyped, + ValidDataTypeLinksToJSON, + ValidDataTypeLinksToJSONTyped, +} from './shared/validdatatypelinks'; +import type { AccountType } from './shared/accounttype'; +import { + AccountTypeFromJSON, + AccountTypeFromJSONTyped, + AccountTypeToJSON, + AccountTypeToJSONTyped, +} from './shared/accounttype'; + +/** + * > **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. + * + * ## Overview + * + * Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. + * + * The categories for an account include: + * * Asset + * * Expense + * * Income + * * Liability + * * Equity. + * + * The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. + * + * At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. + * + * To determine the list of allowed categories for a specific integration, you can: + * - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). + * - Refer to the integration's own documentation. + * + * > **Accounts with no category** + * > + * > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. + * > + * > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. + * @export + * @interface Account + */ +export interface Account { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the Account interface. + */ +export function instanceOfAccount(value: object): value is Account { + return true; +} + +export function AccountFromJSON(json: any): Account { + return AccountFromJSONTyped(json, false); +} + +export function AccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): Account { + if (json == null) { + return json; + } + return { + + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'fullyQualifiedCategory': json['fullyQualifiedCategory'] == null ? undefined : json['fullyQualifiedCategory'], + 'fullyQualifiedName': json['fullyQualifiedName'] == null ? undefined : json['fullyQualifiedName'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'currentBalance': json['currentBalance'] == null ? undefined : toDecimal(json['currentBalance']), + 'type': json['type'] == null ? undefined : AccountTypeFromJSON(json['type']), + 'status': json['status'] == null ? undefined : AccountStatusFromJSON(json['status']), + 'isBankAccount': json['isBankAccount'] == null ? undefined : json['isBankAccount'], + 'validDatatypeLinks': json['validDatatypeLinks'] == null ? undefined : ((json['validDatatypeLinks'] as Array).map(ValidDataTypeLinksFromJSON)), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'id': json['id'] == null ? undefined : json['id'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function AccountToJSON(json: any): Account { + return AccountToJSONTyped(json, false); +} + +export function AccountToJSONTyped(value?: Account | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'description': value['description'], + 'fullyQualifiedCategory': value['fullyQualifiedCategory'], + 'fullyQualifiedName': value['fullyQualifiedName'], + 'currency': value['currency'], + 'currentBalance': fromDecimal(value['currentBalance']), + 'type': AccountTypeToJSON(value['type']), + 'status': AccountStatusToJSON(value['status']), + 'isBankAccount': value['isBankAccount'], + 'validDatatypeLinks': value['validDatatypeLinks'] == null ? undefined : ((value['validDatatypeLinks'] as Array).map(ValidDataTypeLinksToJSON)), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'id': value['id'], + 'metadata': MetadataToJSON(value['metadata']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + + +export interface AccountAccountingAccount { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} + +export interface AccountCreateResponseAccount { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} + +export interface AccountCreateResponseAccountingAccount { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} + +export interface AccountingAccount { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: CreateAccountResponseMetadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} + +export interface CreateAccountResponseAccount { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} + +export interface CreateAccountResponseAccountingAccount { + /** + * 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. + * @type {string} + * @memberof Account + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof Account + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof Account + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof Account + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof Account + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof Account + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof Account + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof Account + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof Account + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof Account + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof Account + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof Account + */ + supplementalData?: SupplementalData; + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof Account + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof Account + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Account + */ + sourceModifiedDate?: string; +} diff --git a/sync-for-expenses/src/sdk/models/AccountReference1.ts b/sync-for-expenses/src/sdk/models/AccountReference1.ts new file mode 100644 index 000000000..c5d151e75 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/AccountReference1.ts @@ -0,0 +1,66 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * Reference of the account you are transferring money to. + * @export + * @interface AccountReference1 + */ +export interface AccountReference1 { + /** + * 'id' from the Accounts data type. + * @type {string} + * @memberof AccountReference1 + */ + id: string; +} + +/** + * Check if a given object implements the AccountReference1 interface. + */ +export function instanceOfAccountReference1(value: object): value is AccountReference1 { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function AccountReference1FromJSON(json: any): AccountReference1 { + return AccountReference1FromJSONTyped(json, false); +} + +export function AccountReference1FromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountReference1 { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function AccountReference1ToJSON(json: any): AccountReference1 { + return AccountReference1ToJSONTyped(json, false); +} + +export function AccountReference1ToJSONTyped(value?: AccountReference1 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/BankAccountPrototype.ts b/sync-for-expenses/src/sdk/models/BankAccountPrototype.ts new file mode 100644 index 000000000..82a1788df --- /dev/null +++ b/sync-for-expenses/src/sdk/models/BankAccountPrototype.ts @@ -0,0 +1,570 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { BankAccountType } from './_speakeasy_enums'; +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { BankAccountStatus } from './shared/bankaccountstatus'; +import { + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './shared/bankaccountstatus'; + +/** + * + * @export + * @interface BankAccountPrototype + */ +export interface BankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + + +/** + * @export + */ +export const BankAccountPrototypeAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' +} as const; +export type BankAccountPrototypeAccountTypeEnum = typeof BankAccountPrototypeAccountTypeEnum[keyof typeof BankAccountPrototypeAccountTypeEnum]; + + +/** + * Check if a given object implements the BankAccountPrototype interface. + */ +export function instanceOfBankAccountPrototype(value: object): value is BankAccountPrototype { + return true; +} + +export function BankAccountPrototypeFromJSON(json: any): BankAccountPrototype { + return BankAccountPrototypeFromJSONTyped(json, false); +} + +export function BankAccountPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountPrototype { + if (json == null) { + return json; + } + return { + + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + }; +} + +export function BankAccountPrototypeToJSON(json: any): BankAccountPrototype { + return BankAccountPrototypeToJSONTyped(json, false); +} + +export function BankAccountPrototypeToJSONTyped(value?: BankAccountPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + }; +} + + +export interface AccountingBankAccountBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface BankAccountBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface BankAccountCreateResponseBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} + +export interface CreateBankAccountResponseBankAccountPrototype { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccountPrototype + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccountPrototype + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccountPrototype + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccountPrototype + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccountPrototype + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccountPrototype + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccountPrototype + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccountPrototype + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccountPrototype + */ + status?: BankAccountStatus; +} diff --git a/sync-for-expenses/src/sdk/models/CompanyDetails.ts b/sync-for-expenses/src/sdk/models/CompanyDetails.ts new file mode 100644 index 000000000..a9460aa45 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/CompanyDetails.ts @@ -0,0 +1,984 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { CompanyReference } from './shared/companyreference'; +import { + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './shared/companyreference'; + +/** + * + * @export + * @interface CompanyDetails + */ +export interface CompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +/** + * Check if a given object implements the CompanyDetails interface. + */ +export function instanceOfCompanyDetails(value: object): value is CompanyDetails { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyDetailsFromJSON(json: any): CompanyDetails { + return CompanyDetailsFromJSONTyped(json, false); +} + +export function CompanyDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + }; +} + +export function CompanyDetailsToJSON(json: any): CompanyDetails { + return CompanyDetailsToJSONTyped(json, false); +} + +export function CompanyDetailsToJSONTyped(value?: CompanyDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + }; +} + + +export interface CompaniesCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompaniesListResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyCreateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyGetResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyReplaceResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CompanyUpdateResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface CreateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface GetCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ListCompaniesResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface ReplaceCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} + +export interface UpdateCompanyResponseCompanyDetails { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyDetails + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyDetails + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyDetails + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof CompanyDetails + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof CompanyDetails + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof CompanyDetails + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof CompanyDetails + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyDetails + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof CompanyDetails + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof CompanyDetails + */ + referenceSubsidiaryCompanies?: Array; +} diff --git a/sync-for-expenses/src/sdk/models/CreateAccountResponseAllOfData.ts b/sync-for-expenses/src/sdk/models/CreateAccountResponseAllOfData.ts new file mode 100644 index 000000000..7eb089f52 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/CreateAccountResponseAllOfData.ts @@ -0,0 +1,249 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { AccountStatus } from './shared/accountstatus'; +import { + AccountStatusFromJSON, + AccountStatusFromJSONTyped, + AccountStatusToJSON, + AccountStatusToJSONTyped, +} from './shared/accountstatus'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { ValidDataTypeLinks } from './shared/validdatatypelinks'; +import { + ValidDataTypeLinksFromJSON, + ValidDataTypeLinksFromJSONTyped, + ValidDataTypeLinksToJSON, + ValidDataTypeLinksToJSONTyped, +} from './shared/validdatatypelinks'; +import type { AccountType } from './shared/accounttype'; +import { + AccountTypeFromJSON, + AccountTypeFromJSONTyped, + AccountTypeToJSON, + AccountTypeToJSONTyped, +} from './shared/accounttype'; + +/** + * + * @export + * @interface CreateAccountResponseAllOfData + */ +export interface CreateAccountResponseAllOfData { + /** + * Identifier for the account, unique for the company. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + id?: string; + /** + * 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. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof CreateAccountResponseAllOfData + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof CreateAccountResponseAllOfData + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof CreateAccountResponseAllOfData + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof CreateAccountResponseAllOfData + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof CreateAccountResponseAllOfData + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof CreateAccountResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * + * @type {Metadata} + * @memberof CreateAccountResponseAllOfData + */ + metadata?: Metadata; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateAccountResponseAllOfData + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the CreateAccountResponseAllOfData interface. + */ +export function instanceOfCreateAccountResponseAllOfData(value: object): value is CreateAccountResponseAllOfData { + return true; +} + +export function CreateAccountResponseAllOfDataFromJSON(json: any): CreateAccountResponseAllOfData { + return CreateAccountResponseAllOfDataFromJSONTyped(json, false); +} + +export function CreateAccountResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAccountResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'fullyQualifiedCategory': json['fullyQualifiedCategory'] == null ? undefined : json['fullyQualifiedCategory'], + 'fullyQualifiedName': json['fullyQualifiedName'] == null ? undefined : json['fullyQualifiedName'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'currentBalance': json['currentBalance'] == null ? undefined : toDecimal(json['currentBalance']), + 'type': json['type'] == null ? undefined : AccountTypeFromJSON(json['type']), + 'status': json['status'] == null ? undefined : AccountStatusFromJSON(json['status']), + 'isBankAccount': json['isBankAccount'] == null ? undefined : json['isBankAccount'], + 'validDatatypeLinks': json['validDatatypeLinks'] == null ? undefined : ((json['validDatatypeLinks'] as Array).map(ValidDataTypeLinksFromJSON)), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function CreateAccountResponseAllOfDataToJSON(json: any): CreateAccountResponseAllOfData { + return CreateAccountResponseAllOfDataToJSONTyped(json, false); +} + +export function CreateAccountResponseAllOfDataToJSONTyped(value?: CreateAccountResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'description': value['description'], + 'fullyQualifiedCategory': value['fullyQualifiedCategory'], + 'fullyQualifiedName': value['fullyQualifiedName'], + 'currency': value['currency'], + 'currentBalance': fromDecimal(value['currentBalance']), + 'type': AccountTypeToJSON(value['type']), + 'status': AccountStatusToJSON(value['status']), + 'isBankAccount': value['isBankAccount'], + 'validDatatypeLinks': value['validDatatypeLinks'] == null ? undefined : ((value['validDatatypeLinks'] as Array).map(ValidDataTypeLinksToJSON)), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'metadata': MetadataToJSON(value['metadata']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/CreateBankAccountResponseAllOfData.ts b/sync-for-expenses/src/sdk/models/CreateBankAccountResponseAllOfData.ts new file mode 100644 index 000000000..f758817e1 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/CreateBankAccountResponseAllOfData.ts @@ -0,0 +1,262 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { BankAccountType } from './_speakeasy_enums'; +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { BankAccountStatus } from './shared/bankaccountstatus'; +import { + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './shared/bankaccountstatus'; + +/** + * + * @export + * @interface CreateBankAccountResponseAllOfData + */ +export interface CreateBankAccountResponseAllOfData { + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + id?: string; + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof CreateBankAccountResponseAllOfData + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof CreateBankAccountResponseAllOfData + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof CreateBankAccountResponseAllOfData + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof CreateBankAccountResponseAllOfData + */ + status?: BankAccountStatus; + /** + * + * @type {Metadata} + * @memberof CreateBankAccountResponseAllOfData + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof CreateBankAccountResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateBankAccountResponseAllOfData + */ + sourceModifiedDate?: string; +} + + +/** + * @export + */ +export const CreateBankAccountResponseAllOfDataAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' +} as const; +export type CreateBankAccountResponseAllOfDataAccountTypeEnum = typeof CreateBankAccountResponseAllOfDataAccountTypeEnum[keyof typeof CreateBankAccountResponseAllOfDataAccountTypeEnum]; + + +/** + * Check if a given object implements the CreateBankAccountResponseAllOfData interface. + */ +export function instanceOfCreateBankAccountResponseAllOfData(value: object): value is CreateBankAccountResponseAllOfData { + return true; +} + +export function CreateBankAccountResponseAllOfDataFromJSON(json: any): CreateBankAccountResponseAllOfData { + return CreateBankAccountResponseAllOfDataFromJSONTyped(json, false); +} + +export function CreateBankAccountResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBankAccountResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function CreateBankAccountResponseAllOfDataToJSON(json: any): CreateBankAccountResponseAllOfData { + return CreateBankAccountResponseAllOfDataToJSONTyped(json, false); +} + +export function CreateBankAccountResponseAllOfDataToJSONTyped(value?: CreateBankAccountResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/CreateCompanyRequest.ts b/sync-for-expenses/src/sdk/models/CreateCompanyRequest.ts new file mode 100644 index 000000000..ec06f2e2e --- /dev/null +++ b/sync-for-expenses/src/sdk/models/CreateCompanyRequest.ts @@ -0,0 +1,12 @@ +/* tslint:disable */ + +import type { CompanyRequestBody } from './shared/companyrequestbody'; +/* eslint-disable */ + +export interface CreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} + +export interface CompanyRequestBodyCreateCompanyRequest { + companyRequestBody?: CompanyRequestBody | undefined; +} diff --git a/sync-for-expenses/src/sdk/models/CreateCustomerResponseAllOfData.ts b/sync-for-expenses/src/sdk/models/CreateCustomerResponseAllOfData.ts new file mode 100644 index 000000000..3b787cd6e --- /dev/null +++ b/sync-for-expenses/src/sdk/models/CreateCustomerResponseAllOfData.ts @@ -0,0 +1,236 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { CustomerStatus } from './shared/customerstatus'; +import { + CustomerStatusFromJSON, + CustomerStatusFromJSONTyped, + CustomerStatusToJSON, + CustomerStatusToJSONTyped, +} from './shared/customerstatus'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { Items } from './shared/items'; +import { + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './shared/items'; +import type { Contact } from './shared/contact'; +import { + ContactFromJSON, + ContactFromJSONTyped, + ContactToJSON, + ContactToJSONTyped, +} from './shared/contact'; + +/** + * + * @export + * @interface CreateCustomerResponseAllOfData + */ +export interface CreateCustomerResponseAllOfData { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CreateCustomerResponseAllOfData + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof CreateCustomerResponseAllOfData + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof CreateCustomerResponseAllOfData + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof CreateCustomerResponseAllOfData + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof CreateCustomerResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateCustomerResponseAllOfData + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the CreateCustomerResponseAllOfData interface. + */ +export function instanceOfCreateCustomerResponseAllOfData(value: object): value is CreateCustomerResponseAllOfData { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function CreateCustomerResponseAllOfDataFromJSON(json: any): CreateCustomerResponseAllOfData { + return CreateCustomerResponseAllOfDataFromJSONTyped(json, false); +} + +export function CreateCustomerResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateCustomerResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'customerName': json['customerName'] == null ? undefined : json['customerName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(ItemsFromJSON)), + 'contacts': json['contacts'] == null ? undefined : ((json['contacts'] as Array).map(ContactFromJSON)), + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'status': CustomerStatusFromJSON(json['status']), + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function CreateCustomerResponseAllOfDataToJSON(json: any): CreateCustomerResponseAllOfData { + return CreateCustomerResponseAllOfDataToJSONTyped(json, false); +} + +export function CreateCustomerResponseAllOfDataToJSONTyped(value?: CreateCustomerResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'customerName': value['customerName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'defaultCurrency': value['defaultCurrency'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(ItemsToJSON)), + 'contacts': value['contacts'] == null ? undefined : ((value['contacts'] as Array).map(ContactToJSON)), + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'status': CustomerStatusToJSON(value['status']), + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/CreateSupplierResponseAllOfData.ts b/sync-for-expenses/src/sdk/models/CreateSupplierResponseAllOfData.ts new file mode 100644 index 000000000..7ba5210d3 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/CreateSupplierResponseAllOfData.ts @@ -0,0 +1,215 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { SupplierStatus } from './shared/supplierstatus'; +import { + SupplierStatusFromJSON, + SupplierStatusFromJSONTyped, + SupplierStatusToJSON, + SupplierStatusToJSONTyped, +} from './shared/supplierstatus'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { Items } from './shared/items'; +import { + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './shared/items'; + +/** + * + * @export + * @interface CreateSupplierResponseAllOfData + */ +export interface CreateSupplierResponseAllOfData { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CreateSupplierResponseAllOfData + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof CreateSupplierResponseAllOfData + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof CreateSupplierResponseAllOfData + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof CreateSupplierResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof CreateSupplierResponseAllOfData + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the CreateSupplierResponseAllOfData interface. + */ +export function instanceOfCreateSupplierResponseAllOfData(value: object): value is CreateSupplierResponseAllOfData { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function CreateSupplierResponseAllOfDataFromJSON(json: any): CreateSupplierResponseAllOfData { + return CreateSupplierResponseAllOfDataFromJSONTyped(json, false); +} + +export function CreateSupplierResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSupplierResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'supplierName': json['supplierName'] == null ? undefined : json['supplierName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(ItemsFromJSON)), + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'status': SupplierStatusFromJSON(json['status']), + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function CreateSupplierResponseAllOfDataToJSON(json: any): CreateSupplierResponseAllOfData { + return CreateSupplierResponseAllOfDataToJSONTyped(json, false); +} + +export function CreateSupplierResponseAllOfDataToJSONTyped(value?: CreateSupplierResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'supplierName': value['supplierName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(ItemsToJSON)), + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'status': SupplierStatusToJSON(value['status']), + 'defaultCurrency': value['defaultCurrency'], + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/DataStatuses.ts b/sync-for-expenses/src/sdk/models/DataStatuses.ts new file mode 100644 index 000000000..d019eb1e3 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/DataStatuses.ts @@ -0,0 +1,1453 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { DataStatus } from './shared/datastatus'; +import { + DataStatusFromJSON, + DataStatusFromJSONTyped, + DataStatusToJSON, + DataStatusToJSONTyped, +} from './shared/datastatus'; + +/** + * + * @export + * @interface DataStatuses + */ +export interface DataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} + +/** + * Check if a given object implements the DataStatuses interface. + */ +export function instanceOfDataStatuses(value: object): value is DataStatuses { + return true; +} + +export function DataStatusesFromJSON(json: any): DataStatuses { + return DataStatusesFromJSONTyped(json, false); +} + +export function DataStatusesFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataStatuses { + if (json == null) { + return json; + } + return { + + 'accountTransactions': json['accountTransactions'] == null ? undefined : DataStatusFromJSON(json['accountTransactions']), + 'balanceSheet': json['balanceSheet'] == null ? undefined : DataStatusFromJSON(json['balanceSheet']), + 'bankAccounts': json['bankAccounts'] == null ? undefined : DataStatusFromJSON(json['bankAccounts']), + 'bankTransactions': json['bankTransactions'] == null ? undefined : DataStatusFromJSON(json['bankTransactions']), + 'billCreditNotes': json['billCreditNotes'] == null ? undefined : DataStatusFromJSON(json['billCreditNotes']), + 'billPayments': json['billPayments'] == null ? undefined : DataStatusFromJSON(json['billPayments']), + 'bills': json['bills'] == null ? undefined : DataStatusFromJSON(json['bills']), + 'cashFlowStatement': json['cashFlowStatement'] == null ? undefined : DataStatusFromJSON(json['cashFlowStatement']), + 'chartOfAccounts': json['chartOfAccounts'] == null ? undefined : DataStatusFromJSON(json['chartOfAccounts']), + 'company': json['company'] == null ? undefined : DataStatusFromJSON(json['company']), + 'creditNotes': json['creditNotes'] == null ? undefined : DataStatusFromJSON(json['creditNotes']), + 'customers': json['customers'] == null ? undefined : DataStatusFromJSON(json['customers']), + 'directCosts': json['directCosts'] == null ? undefined : DataStatusFromJSON(json['directCosts']), + 'directIncomes': json['directIncomes'] == null ? undefined : DataStatusFromJSON(json['directIncomes']), + 'invoices': json['invoices'] == null ? undefined : DataStatusFromJSON(json['invoices']), + 'itemReceipts': json['itemReceipts'] == null ? undefined : DataStatusFromJSON(json['itemReceipts']), + 'items': json['items'] == null ? undefined : DataStatusFromJSON(json['items']), + 'journalEntries': json['journalEntries'] == null ? undefined : DataStatusFromJSON(json['journalEntries']), + 'journals': json['journals'] == null ? undefined : DataStatusFromJSON(json['journals']), + 'paymentMethods': json['paymentMethods'] == null ? undefined : DataStatusFromJSON(json['paymentMethods']), + 'payments': json['payments'] == null ? undefined : DataStatusFromJSON(json['payments']), + 'profitAndLoss': json['profitAndLoss'] == null ? undefined : DataStatusFromJSON(json['profitAndLoss']), + 'purchaseOrders': json['purchaseOrders'] == null ? undefined : DataStatusFromJSON(json['purchaseOrders']), + 'salesOrders': json['salesOrders'] == null ? undefined : DataStatusFromJSON(json['salesOrders']), + 'suppliers': json['suppliers'] == null ? undefined : DataStatusFromJSON(json['suppliers']), + 'taxRates': json['taxRates'] == null ? undefined : DataStatusFromJSON(json['taxRates']), + 'trackingCategories': json['trackingCategories'] == null ? undefined : DataStatusFromJSON(json['trackingCategories']), + 'transfers': json['transfers'] == null ? undefined : DataStatusFromJSON(json['transfers']), + 'bankingAccountBalances': json['banking-accountBalances'] == null ? undefined : DataStatusFromJSON(json['banking-accountBalances']), + 'bankingAccounts': json['banking-accounts'] == null ? undefined : DataStatusFromJSON(json['banking-accounts']), + 'bankingTransactionCategories': json['banking-transactionCategories'] == null ? undefined : DataStatusFromJSON(json['banking-transactionCategories']), + 'bankingTransactions': json['banking-transactions'] == null ? undefined : DataStatusFromJSON(json['banking-transactions']), + 'commerceCompanyInfo': json['commerce-companyInfo'] == null ? undefined : DataStatusFromJSON(json['commerce-companyInfo']), + 'commerceCustomers': json['commerce-customers'] == null ? undefined : DataStatusFromJSON(json['commerce-customers']), + 'commerceDisputes': json['commerce-disputes'] == null ? undefined : DataStatusFromJSON(json['commerce-disputes']), + 'commerceLocations': json['commerce-locations'] == null ? undefined : DataStatusFromJSON(json['commerce-locations']), + 'commerceOrders': json['commerce-orders'] == null ? undefined : DataStatusFromJSON(json['commerce-orders']), + 'commercePaymentMethods': json['commerce-paymentMethods'] == null ? undefined : DataStatusFromJSON(json['commerce-paymentMethods']), + 'commercePayments': json['commerce-payments'] == null ? undefined : DataStatusFromJSON(json['commerce-payments']), + 'commerceProductCategories': json['commerce-productCategories'] == null ? undefined : DataStatusFromJSON(json['commerce-productCategories']), + 'commerceProducts': json['commerce-products'] == null ? undefined : DataStatusFromJSON(json['commerce-products']), + 'commerceTaxComponents': json['commerce-taxComponents'] == null ? undefined : DataStatusFromJSON(json['commerce-taxComponents']), + 'commerceTransactions': json['commerce-transactions'] == null ? undefined : DataStatusFromJSON(json['commerce-transactions']), + }; +} + +export function DataStatusesToJSON(json: any): DataStatuses { + return DataStatusesToJSONTyped(json, false); +} + +export function DataStatusesToJSONTyped(value?: DataStatuses | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountTransactions': DataStatusToJSON(value['accountTransactions']), + 'balanceSheet': DataStatusToJSON(value['balanceSheet']), + 'bankAccounts': DataStatusToJSON(value['bankAccounts']), + 'bankTransactions': DataStatusToJSON(value['bankTransactions']), + 'billCreditNotes': DataStatusToJSON(value['billCreditNotes']), + 'billPayments': DataStatusToJSON(value['billPayments']), + 'bills': DataStatusToJSON(value['bills']), + 'cashFlowStatement': DataStatusToJSON(value['cashFlowStatement']), + 'chartOfAccounts': DataStatusToJSON(value['chartOfAccounts']), + 'company': DataStatusToJSON(value['company']), + 'creditNotes': DataStatusToJSON(value['creditNotes']), + 'customers': DataStatusToJSON(value['customers']), + 'directCosts': DataStatusToJSON(value['directCosts']), + 'directIncomes': DataStatusToJSON(value['directIncomes']), + 'invoices': DataStatusToJSON(value['invoices']), + 'itemReceipts': DataStatusToJSON(value['itemReceipts']), + 'items': DataStatusToJSON(value['items']), + 'journalEntries': DataStatusToJSON(value['journalEntries']), + 'journals': DataStatusToJSON(value['journals']), + 'paymentMethods': DataStatusToJSON(value['paymentMethods']), + 'payments': DataStatusToJSON(value['payments']), + 'profitAndLoss': DataStatusToJSON(value['profitAndLoss']), + 'purchaseOrders': DataStatusToJSON(value['purchaseOrders']), + 'salesOrders': DataStatusToJSON(value['salesOrders']), + 'suppliers': DataStatusToJSON(value['suppliers']), + 'taxRates': DataStatusToJSON(value['taxRates']), + 'trackingCategories': DataStatusToJSON(value['trackingCategories']), + 'transfers': DataStatusToJSON(value['transfers']), + 'banking-accountBalances': DataStatusToJSON(value['bankingAccountBalances']), + 'banking-accounts': DataStatusToJSON(value['bankingAccounts']), + 'banking-transactionCategories': DataStatusToJSON(value['bankingTransactionCategories']), + 'banking-transactions': DataStatusToJSON(value['bankingTransactions']), + 'commerce-companyInfo': DataStatusToJSON(value['commerceCompanyInfo']), + 'commerce-customers': DataStatusToJSON(value['commerceCustomers']), + 'commerce-disputes': DataStatusToJSON(value['commerceDisputes']), + 'commerce-locations': DataStatusToJSON(value['commerceLocations']), + 'commerce-orders': DataStatusToJSON(value['commerceOrders']), + 'commerce-paymentMethods': DataStatusToJSON(value['commercePaymentMethods']), + 'commerce-payments': DataStatusToJSON(value['commercePayments']), + 'commerce-productCategories': DataStatusToJSON(value['commerceProductCategories']), + 'commerce-products': DataStatusToJSON(value['commerceProducts']), + 'commerce-taxComponents': DataStatusToJSON(value['commerceTaxComponents']), + 'commerce-transactions': DataStatusToJSON(value['commerceTransactions']), + }; +} + + +export interface DataStatusGetDataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} + +export interface DataStatusGetResponseDataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} + +export interface GetDataStatusDataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} + +export interface GetDataStatusResponseDataStatuses { + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + accountTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + balanceSheet?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billCreditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + billPayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bills?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + cashFlowStatement?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + chartOfAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + company?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + creditNotes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + customers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directCosts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + directIncomes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + invoices?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + itemReceipts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + items?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journalEntries?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + journals?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + paymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + payments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + profitAndLoss?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + purchaseOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + salesOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + suppliers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + taxRates?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + trackingCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + transfers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccountBalances?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingAccounts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactionCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + bankingTransactions?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCompanyInfo?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceCustomers?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceDisputes?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceLocations?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceOrders?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePaymentMethods?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commercePayments?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProductCategories?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceProducts?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTaxComponents?: DataStatus; + /** + * + * @type {DataStatus} + * @memberof DataStatuses + */ + commerceTransactions?: DataStatus; +} diff --git a/sync-for-expenses/src/sdk/models/ErrorMessage.ts b/sync-for-expenses/src/sdk/models/ErrorMessage.ts new file mode 100644 index 000000000..a0aa53d45 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/ErrorMessage.ts @@ -0,0 +1,166 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { ErrorValidation } from './shared/errorvalidation'; +import { + ErrorValidationFromJSON, + ErrorValidationFromJSONTyped, + ErrorValidationToJSON, + ErrorValidationToJSONTyped, +} from './shared/errorvalidation'; + +/** + * + * @export + * @interface ErrorMessage + */ +export interface ErrorMessage { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} + +/** + * Check if a given object implements the ErrorMessage interface. + */ +export function instanceOfErrorMessage(value: object): value is ErrorMessage { + return true; +} + +export function ErrorMessageFromJSON(json: any): ErrorMessage { + return ErrorMessageFromJSONTyped(json, false); +} + +export function ErrorMessageFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorMessage { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'service': json['service'] == null ? undefined : json['service'], + 'error': json['error'] == null ? undefined : json['error'], + 'correlationId': json['correlationId'] == null ? undefined : json['correlationId'], + 'validation': json['validation'] == null ? undefined : ErrorValidationFromJSON(json['validation']), + 'canBeRetried': json['canBeRetried'] == null ? undefined : json['canBeRetried'], + 'detailedErrorCode': json['detailedErrorCode'] == null ? undefined : json['detailedErrorCode'], + }; +} + +export function ErrorMessageToJSON(json: any): ErrorMessage { + return ErrorMessageToJSONTyped(json, false); +} + +export function ErrorMessageToJSONTyped(value?: ErrorMessage | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'service': value['service'], + 'error': value['error'], + 'correlationId': value['correlationId'], + 'validation': ErrorValidationToJSON(value['validation']), + 'canBeRetried': value['canBeRetried'], + 'detailedErrorCode': value['detailedErrorCode'], + }; +} + + +export interface ErrorMessageData { + /** + * The HTTP status code returned by the error. + * @type {number} + * @memberof ErrorMessage + */ + statusCode?: number; + /** + * Codat's service the returned the error. + * @type {string} + * @memberof ErrorMessage + */ + service?: string; + /** + * A brief description of the error. + * @type {string} + * @memberof ErrorMessage + */ + error?: string; + /** + * Unique identifier used to propagate to all downstream services and determine the source of the error. + * @type {string} + * @memberof ErrorMessage + */ + correlationId?: string; + /** + * + * @type {ErrorValidation} + * @memberof ErrorMessage + */ + validation?: ErrorValidation | null; + /** + * `True` if the error occurred transiently and can be retried. + * @type {string} + * @memberof ErrorMessage + */ + canBeRetried?: string; + /** + * Machine readable error code used to automate processes based on the code returned. + * @type {number} + * @memberof ErrorMessage + */ + detailedErrorCode?: number; +} diff --git a/sync-for-expenses/src/sdk/models/Model3.ts b/sync-for-expenses/src/sdk/models/Model3.ts new file mode 100644 index 000000000..6f58f0946 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/Model3.ts @@ -0,0 +1,87 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface Model3 + */ +export interface Model3 { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Model3 + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Model3 + */ + sourceModifiedDate?: string; +} + +/** + * Check if a given object implements the Model3 interface. + */ +export function instanceOfModel3(value: object): value is Model3 { + return true; +} + +export function Model3FromJSON(json: any): Model3 { + return Model3FromJSONTyped(json, false); +} + +export function Model3FromJSONTyped(json: any, ignoreDiscriminator: boolean): Model3 { + if (json == null) { + return json; + } + return { + + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function Model3ToJSON(json: any): Model3 { + return Model3ToJSONTyped(json, false); +} + +export function Model3ToJSONTyped(value?: Model3 | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/PagingInfo.ts b/sync-for-expenses/src/sdk/models/PagingInfo.ts new file mode 100644 index 000000000..8d929a214 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/PagingInfo.ts @@ -0,0 +1,1289 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { Links } from './shared/links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './shared/links'; + +/** + * + * @export + * @interface PagingInfo + */ +export interface PagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +/** + * Check if a given object implements the PagingInfo interface. + */ +export function instanceOfPagingInfo(value: object): value is PagingInfo { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PagingInfoFromJSON(json: any): PagingInfo { + return PagingInfoFromJSONTyped(json, false); +} + +export function PagingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PagingInfo { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + }; +} + +export function PagingInfoToJSON(json: any): PagingInfo { + return PagingInfoToJSONTyped(json, false); +} + +export function PagingInfoToJSONTyped(value?: PagingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + }; +} + + +export interface CompaniesListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CompaniesPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ConnectionsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CustomersListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CustomersListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CustomersPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface CustomersPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCompaniesResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCompaniesResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListConnectionsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListConnectionsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCustomersResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListCustomersResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListPullOperationsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListPullOperationsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListPushOperationsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListPushOperationsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListSuppliersResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListSuppliersResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListSyncTransactionsResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface ListSyncTransactionsResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PagingInfoPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PullOperationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface PushOperationsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface SuppliersListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface SuppliersListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface SuppliersPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface SuppliersPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface SyncTransactionsListResponsePaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface SyncTransactionsListResponsePagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface TransactionsPaginationInformation { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} + +export interface TransactionsPagingInfo { + /** + * Current page number. + * @type {number} + * @memberof PagingInfo + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PagingInfo + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PagingInfo + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PagingInfo + */ + links: Links; +} diff --git a/sync-for-expenses/src/sdk/models/SyncCompleteWebhook.ts b/sync-for-expenses/src/sdk/models/SyncCompleteWebhook.ts new file mode 100644 index 000000000..ab1bfc030 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/SyncCompleteWebhook.ts @@ -0,0 +1,130 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { SyncCompleteWebhookData } from './SyncCompleteWebhookData'; +import { + SyncCompleteWebhookDataFromJSON, + SyncCompleteWebhookDataFromJSONTyped, + SyncCompleteWebhookDataToJSON, + SyncCompleteWebhookDataToJSONTyped, +} from './SyncCompleteWebhookData'; + +/** + * Webhook request body used to notify that a sync has completed. + * @export + * @interface SyncCompleteWebhook + */ +export interface SyncCompleteWebhook { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof SyncCompleteWebhook + */ + clientId?: string; + /** + * Name of your client in Codat. + * @type {string} + * @memberof SyncCompleteWebhook + */ + clientName?: string; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SyncCompleteWebhook + */ + companyId?: string; + /** + * Unique identifier for the rule. + * @type {string} + * @memberof SyncCompleteWebhook + * @deprecated + */ + ruleId?: string; + /** + * The type of rule. + * @type {string} + * @memberof SyncCompleteWebhook + */ + ruleType?: string; + /** + * Unique identifier of the webhook event. + * @type {string} + * @memberof SyncCompleteWebhook + */ + alertId?: string; + /** + * A human-readable message about the webhook. + * @type {string} + * @memberof SyncCompleteWebhook + */ + message?: string; + /** + * + * @type {SyncCompleteWebhookData} + * @memberof SyncCompleteWebhook + */ + data?: SyncCompleteWebhookData; +} + +/** + * Check if a given object implements the SyncCompleteWebhook interface. + */ +export function instanceOfSyncCompleteWebhook(value: object): value is SyncCompleteWebhook { + return true; +} + +export function SyncCompleteWebhookFromJSON(json: any): SyncCompleteWebhook { + return SyncCompleteWebhookFromJSONTyped(json, false); +} + +export function SyncCompleteWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncCompleteWebhook { + if (json == null) { + return json; + } + return { + + 'clientId': json['ClientId'] == null ? undefined : json['ClientId'], + 'clientName': json['ClientName'] == null ? undefined : json['ClientName'], + 'companyId': json['CompanyId'] == null ? undefined : json['CompanyId'], + 'ruleId': json['RuleId'] == null ? undefined : json['RuleId'], + 'ruleType': json['RuleType'] == null ? undefined : json['RuleType'], + 'alertId': json['AlertId'] == null ? undefined : json['AlertId'], + 'message': json['Message'] == null ? undefined : json['Message'], + 'data': json['Data'] == null ? undefined : SyncCompleteWebhookDataFromJSON(json['Data']), + }; +} + +export function SyncCompleteWebhookToJSON(json: any): SyncCompleteWebhook { + return SyncCompleteWebhookToJSONTyped(json, false); +} + +export function SyncCompleteWebhookToJSONTyped(value?: SyncCompleteWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ClientId': value['clientId'], + 'ClientName': value['clientName'], + 'CompanyId': value['companyId'], + 'RuleId': value['ruleId'], + 'RuleType': value['ruleType'], + 'AlertId': value['alertId'], + 'Message': value['message'], + 'Data': SyncCompleteWebhookDataToJSON(value['data']), + }; +} + diff --git a/sync-for-expenses/src/sdk/models/SyncCompleteWebhookData.ts b/sync-for-expenses/src/sdk/models/SyncCompleteWebhookData.ts new file mode 100644 index 000000000..e83b76515 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/SyncCompleteWebhookData.ts @@ -0,0 +1,88 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface SyncCompleteWebhookData + */ +export interface SyncCompleteWebhookData { + /** + * Unique identifier for the failed sync. + * @type {string} + * @memberof SyncCompleteWebhookData + */ + syncId?: string; + /** + * The type of sync being performed. + * @type {string} + * @memberof SyncCompleteWebhookData + */ + syncType?: string; +} + +/** + * Check if a given object implements the SyncCompleteWebhookData interface. + */ +export function instanceOfSyncCompleteWebhookData(value: object): value is SyncCompleteWebhookData { + return true; +} + +export function SyncCompleteWebhookDataFromJSON(json: any): SyncCompleteWebhookData { + return SyncCompleteWebhookDataFromJSONTyped(json, false); +} + +export function SyncCompleteWebhookDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncCompleteWebhookData { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + 'syncType': json['syncType'] == null ? undefined : json['syncType'], + }; +} + +export function SyncCompleteWebhookDataToJSON(json: any): SyncCompleteWebhookData { + return SyncCompleteWebhookDataToJSONTyped(json, false); +} + +export function SyncCompleteWebhookDataToJSONTyped(value?: SyncCompleteWebhookData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + 'syncType': value['syncType'], + }; +} + + +export interface SyncCompleteWebhookSyncCompleteWebhookData { + /** + * Unique identifier for the failed sync. + * @type {string} + * @memberof SyncCompleteWebhookData + */ + syncId?: string; + /** + * The type of sync being performed. + * @type {string} + * @memberof SyncCompleteWebhookData + */ + syncType?: string; +} diff --git a/sync-for-expenses/src/sdk/models/SyncFailedWebhook.ts b/sync-for-expenses/src/sdk/models/SyncFailedWebhook.ts new file mode 100644 index 000000000..b3b1aa054 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/SyncFailedWebhook.ts @@ -0,0 +1,130 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { SyncFailedWebhookData } from './SyncFailedWebhookData'; +import { + SyncFailedWebhookDataFromJSON, + SyncFailedWebhookDataFromJSONTyped, + SyncFailedWebhookDataToJSON, + SyncFailedWebhookDataToJSONTyped, +} from './SyncFailedWebhookData'; + +/** + * Webhook request body used to notify that a sync has failed. + * @export + * @interface SyncFailedWebhook + */ +export interface SyncFailedWebhook { + /** + * Unique identifier for your client in Codat. + * @type {string} + * @memberof SyncFailedWebhook + */ + clientId?: string; + /** + * Name of your client in Codat. + * @type {string} + * @memberof SyncFailedWebhook + */ + clientName?: string; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof SyncFailedWebhook + */ + companyId?: string; + /** + * Unique identifier for the rule. + * @type {string} + * @memberof SyncFailedWebhook + * @deprecated + */ + ruleId?: string; + /** + * The type of rule. + * @type {string} + * @memberof SyncFailedWebhook + */ + ruleType?: string; + /** + * Unique identifier of the webhook event. + * @type {string} + * @memberof SyncFailedWebhook + */ + alertId?: string; + /** + * A human-readable message about the webhook. + * @type {string} + * @memberof SyncFailedWebhook + */ + message?: string; + /** + * + * @type {SyncFailedWebhookData} + * @memberof SyncFailedWebhook + */ + data?: SyncFailedWebhookData; +} + +/** + * Check if a given object implements the SyncFailedWebhook interface. + */ +export function instanceOfSyncFailedWebhook(value: object): value is SyncFailedWebhook { + return true; +} + +export function SyncFailedWebhookFromJSON(json: any): SyncFailedWebhook { + return SyncFailedWebhookFromJSONTyped(json, false); +} + +export function SyncFailedWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncFailedWebhook { + if (json == null) { + return json; + } + return { + + 'clientId': json['ClientId'] == null ? undefined : json['ClientId'], + 'clientName': json['ClientName'] == null ? undefined : json['ClientName'], + 'companyId': json['CompanyId'] == null ? undefined : json['CompanyId'], + 'ruleId': json['RuleId'] == null ? undefined : json['RuleId'], + 'ruleType': json['RuleType'] == null ? undefined : json['RuleType'], + 'alertId': json['AlertId'] == null ? undefined : json['AlertId'], + 'message': json['Message'] == null ? undefined : json['Message'], + 'data': json['Data'] == null ? undefined : SyncFailedWebhookDataFromJSON(json['Data']), + }; +} + +export function SyncFailedWebhookToJSON(json: any): SyncFailedWebhook { + return SyncFailedWebhookToJSONTyped(json, false); +} + +export function SyncFailedWebhookToJSONTyped(value?: SyncFailedWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'ClientId': value['clientId'], + 'ClientName': value['clientName'], + 'CompanyId': value['companyId'], + 'RuleId': value['ruleId'], + 'RuleType': value['ruleType'], + 'AlertId': value['alertId'], + 'Message': value['message'], + 'Data': SyncFailedWebhookDataToJSON(value['data']), + }; +} + diff --git a/sync-for-expenses/src/sdk/models/SyncFailedWebhookData.ts b/sync-for-expenses/src/sdk/models/SyncFailedWebhookData.ts new file mode 100644 index 000000000..22a5127b7 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/SyncFailedWebhookData.ts @@ -0,0 +1,102 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface SyncFailedWebhookData + */ +export interface SyncFailedWebhookData { + /** + * Unique identifier for the failed sync. + * @type {string} + * @memberof SyncFailedWebhookData + */ + syncId?: string; + /** + * The type of sync being performed. + * @type {string} + * @memberof SyncFailedWebhookData + */ + syncType?: string; + /** + * The stage of the job the sync failed. + * @type {string} + * @memberof SyncFailedWebhookData + */ + failureStage?: string; +} + +/** + * Check if a given object implements the SyncFailedWebhookData interface. + */ +export function instanceOfSyncFailedWebhookData(value: object): value is SyncFailedWebhookData { + return true; +} + +export function SyncFailedWebhookDataFromJSON(json: any): SyncFailedWebhookData { + return SyncFailedWebhookDataFromJSONTyped(json, false); +} + +export function SyncFailedWebhookDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncFailedWebhookData { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + 'syncType': json['syncType'] == null ? undefined : json['syncType'], + 'failureStage': json['FailureStage'] == null ? undefined : json['FailureStage'], + }; +} + +export function SyncFailedWebhookDataToJSON(json: any): SyncFailedWebhookData { + return SyncFailedWebhookDataToJSONTyped(json, false); +} + +export function SyncFailedWebhookDataToJSONTyped(value?: SyncFailedWebhookData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + 'syncType': value['syncType'], + 'FailureStage': value['failureStage'], + }; +} + + +export interface SyncFailedWebhookSyncFailedWebhookData { + /** + * Unique identifier for the failed sync. + * @type {string} + * @memberof SyncFailedWebhookData + */ + syncId?: string; + /** + * The type of sync being performed. + * @type {string} + * @memberof SyncFailedWebhookData + */ + syncType?: string; + /** + * The stage of the job the sync failed. + * @type {string} + * @memberof SyncFailedWebhookData + */ + failureStage?: string; +} diff --git a/sync-for-expenses/src/sdk/models/SyncInitiated.ts b/sync-for-expenses/src/sdk/models/SyncInitiated.ts new file mode 100644 index 000000000..0c77684c6 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/SyncInitiated.ts @@ -0,0 +1,68 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +/** + * + * @export + * @interface SyncInitiated + */ +export interface SyncInitiated { + [key: string]: any | any; + /** + * Unique identifier for the sync initiated. + * @type {string} + * @memberof SyncInitiated + */ + syncId?: string; +} + +/** + * Check if a given object implements the SyncInitiated interface. + */ +export function instanceOfSyncInitiated(value: object): value is SyncInitiated { + return true; +} + +export function SyncInitiatedFromJSON(json: any): SyncInitiated { + return SyncInitiatedFromJSONTyped(json, false); +} + +export function SyncInitiatedFromJSONTyped(json: any, ignoreDiscriminator: boolean): SyncInitiated { + if (json == null) { + return json; + } + return { + + ...json, + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + }; +} + +export function SyncInitiatedToJSON(json: any): SyncInitiated { + return SyncInitiatedToJSONTyped(json, false); +} + +export function SyncInitiatedToJSONTyped(value?: SyncInitiated | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'syncId': value['syncId'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/TransferTransactionRequestFrom.ts b/sync-for-expenses/src/sdk/models/TransferTransactionRequestFrom.ts new file mode 100644 index 000000000..04653d135 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/TransferTransactionRequestFrom.ts @@ -0,0 +1,99 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { AccountReference } from './shared/accountreference'; +import { + AccountReferenceFromJSON, + AccountReferenceFromJSONTyped, + AccountReferenceToJSON, + AccountReferenceToJSONTyped, +} from './shared/accountreference'; + +/** + * + * @export + * @interface TransferTransactionRequestFrom + */ +export interface TransferTransactionRequestFrom { + /** + * + * @type {AccountReference} + * @memberof TransferTransactionRequestFrom + */ + accountRef: AccountReference; + /** + * Amount that has been transferred from the account in the native currency of the account. + * @type {number} + * @memberof TransferTransactionRequestFrom + */ + amount: Decimal | number; +} + +/** + * Check if a given object implements the TransferTransactionRequestFrom interface. + */ +export function instanceOfTransferTransactionRequestFrom(value: object): value is TransferTransactionRequestFrom { + if (!('accountRef' in value) || value['accountRef'] === undefined) return false; + if (!('amount' in value) || value['amount'] === undefined) return false; + return true; +} + +export function TransferTransactionRequestFromFromJSON(json: any): TransferTransactionRequestFrom { + return TransferTransactionRequestFromFromJSONTyped(json, false); +} + +export function TransferTransactionRequestFromFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransferTransactionRequestFrom { + if (json == null) { + return json; + } + return { + + 'accountRef': AccountReferenceFromJSON(json['accountRef']), + 'amount': json['amount'], + }; +} + +export function TransferTransactionRequestFromToJSON(json: any): TransferTransactionRequestFrom { + return TransferTransactionRequestFromToJSONTyped(json, false); +} + +export function TransferTransactionRequestFromToJSONTyped(value?: TransferTransactionRequestFrom | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountRef': AccountReferenceToJSON(value['accountRef']), + 'amount': fromDecimal(value['amount']), + }; +} + + +export interface From { + /** + * + * @type {AccountReference} + * @memberof TransferTransactionRequestFrom + */ + accountRef: AccountReference; + /** + * Amount that has been transferred from the account in the native currency of the account. + * @type {number} + * @memberof TransferTransactionRequestFrom + */ + amount: Decimal | number; +} diff --git a/sync-for-expenses/src/sdk/models/TransferTransactionRequestTo.ts b/sync-for-expenses/src/sdk/models/TransferTransactionRequestTo.ts new file mode 100644 index 000000000..6612d764f --- /dev/null +++ b/sync-for-expenses/src/sdk/models/TransferTransactionRequestTo.ts @@ -0,0 +1,100 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { TransferTransactionRequestAccountReference } from './shared/accountreference'; +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { AccountReference1 } from './AccountReference1'; +import { + AccountReference1FromJSON, + AccountReference1FromJSONTyped, + AccountReference1ToJSON, + AccountReference1ToJSONTyped, +} from './AccountReference1'; + +/** + * + * @export + * @interface TransferTransactionRequestTo + */ +export interface TransferTransactionRequestTo { + /** + * + * @type {AccountReference1} + * @memberof TransferTransactionRequestTo + */ + accountRef: AccountReference1; + /** + * Amount that has been transferred to the account in the native currency of the account. + * @type {number} + * @memberof TransferTransactionRequestTo + */ + amount: Decimal | number; +} + +/** + * Check if a given object implements the TransferTransactionRequestTo interface. + */ +export function instanceOfTransferTransactionRequestTo(value: object): value is TransferTransactionRequestTo { + if (!('accountRef' in value) || value['accountRef'] === undefined) return false; + if (!('amount' in value) || value['amount'] === undefined) return false; + return true; +} + +export function TransferTransactionRequestToFromJSON(json: any): TransferTransactionRequestTo { + return TransferTransactionRequestToFromJSONTyped(json, false); +} + +export function TransferTransactionRequestToFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransferTransactionRequestTo { + if (json == null) { + return json; + } + return { + + 'accountRef': AccountReference1FromJSON(json['accountRef']), + 'amount': json['amount'], + }; +} + +export function TransferTransactionRequestToToJSON(json: any): TransferTransactionRequestTo { + return TransferTransactionRequestToToJSONTyped(json, false); +} + +export function TransferTransactionRequestToToJSONTyped(value?: TransferTransactionRequestTo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountRef': AccountReference1ToJSON(value['accountRef']), + 'amount': fromDecimal(value['amount']), + }; +} + + +export interface To { + /** + * + * @type {AccountReference1} + * @memberof TransferTransactionRequestTo + */ + accountRef: TransferTransactionRequestAccountReference; + /** + * Amount that has been transferred to the account in the native currency of the account. + * @type {number} + * @memberof TransferTransactionRequestTo + */ + amount: Decimal | number; +} diff --git a/sync-for-expenses/src/sdk/models/UpdateConnection.ts b/sync-for-expenses/src/sdk/models/UpdateConnection.ts new file mode 100644 index 000000000..503e519d2 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/UpdateConnection.ts @@ -0,0 +1,108 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { DataConnectionStatus } from './shared/dataconnectionstatus'; +import { + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './shared/dataconnectionstatus'; + +/** + * + * @export + * @interface UpdateConnection + */ +export interface UpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + + + +/** + * Check if a given object implements the UpdateConnection interface. + */ +export function instanceOfUpdateConnection(value: object): value is UpdateConnection { + return true; +} + +export function UpdateConnectionFromJSON(json: any): UpdateConnection { + return UpdateConnectionFromJSONTyped(json, false); +} + +export function UpdateConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateConnection { + if (json == null) { + return json; + } + return { + + ...json, + 'status': json['status'] == null ? undefined : DataConnectionStatusFromJSON(json['status']), + }; +} + +export function UpdateConnectionToJSON(json: any): UpdateConnection { + return UpdateConnectionToJSONTyped(json, false); +} + +export function UpdateConnectionToJSONTyped(value?: UpdateConnection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'status': DataConnectionStatusToJSON(value['status']), + }; +} + + +export interface ConnectionUnlinkRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionRequestBody { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} + +export interface UnlinkConnectionUpdateConnection { + [key: string]: any | any; + /** + * The current authorization status of the data connection. + * @type {DataConnectionStatus} + * @memberof UpdateConnection + */ + status?: DataConnectionStatus; +} diff --git a/sync-for-expenses/src/sdk/models/UpdateCustomerResponseAllOfData.ts b/sync-for-expenses/src/sdk/models/UpdateCustomerResponseAllOfData.ts new file mode 100644 index 000000000..21190b806 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/UpdateCustomerResponseAllOfData.ts @@ -0,0 +1,236 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { CustomerStatus } from './shared/customerstatus'; +import { + CustomerStatusFromJSON, + CustomerStatusFromJSONTyped, + CustomerStatusToJSON, + CustomerStatusToJSONTyped, +} from './shared/customerstatus'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { Items } from './shared/items'; +import { + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './shared/items'; +import type { Contact } from './shared/contact'; +import { + ContactFromJSON, + ContactFromJSONTyped, + ContactToJSON, + ContactToJSONTyped, +} from './shared/contact'; + +/** + * + * @export + * @interface UpdateCustomerResponseAllOfData + */ +export interface UpdateCustomerResponseAllOfData { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof UpdateCustomerResponseAllOfData + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof UpdateCustomerResponseAllOfData + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof UpdateCustomerResponseAllOfData + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof UpdateCustomerResponseAllOfData + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof UpdateCustomerResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof UpdateCustomerResponseAllOfData + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the UpdateCustomerResponseAllOfData interface. + */ +export function instanceOfUpdateCustomerResponseAllOfData(value: object): value is UpdateCustomerResponseAllOfData { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function UpdateCustomerResponseAllOfDataFromJSON(json: any): UpdateCustomerResponseAllOfData { + return UpdateCustomerResponseAllOfDataFromJSONTyped(json, false); +} + +export function UpdateCustomerResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateCustomerResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'customerName': json['customerName'] == null ? undefined : json['customerName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(ItemsFromJSON)), + 'contacts': json['contacts'] == null ? undefined : ((json['contacts'] as Array).map(ContactFromJSON)), + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'status': CustomerStatusFromJSON(json['status']), + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function UpdateCustomerResponseAllOfDataToJSON(json: any): UpdateCustomerResponseAllOfData { + return UpdateCustomerResponseAllOfDataToJSONTyped(json, false); +} + +export function UpdateCustomerResponseAllOfDataToJSONTyped(value?: UpdateCustomerResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'customerName': value['customerName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'defaultCurrency': value['defaultCurrency'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(ItemsToJSON)), + 'contacts': value['contacts'] == null ? undefined : ((value['contacts'] as Array).map(ContactToJSON)), + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'status': CustomerStatusToJSON(value['status']), + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/UpdateReimbursableExpenseTransactionRequest.ts b/sync-for-expenses/src/sdk/models/UpdateReimbursableExpenseTransactionRequest.ts new file mode 100644 index 000000000..afd3a841b --- /dev/null +++ b/sync-for-expenses/src/sdk/models/UpdateReimbursableExpenseTransactionRequest.ts @@ -0,0 +1,645 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../runtime'; +import type { ReimbursementContactRef } from './shared/reimbursementcontactref'; +import { + ReimbursementContactRefFromJSON, + ReimbursementContactRefFromJSONTyped, + ReimbursementContactRefToJSON, + ReimbursementContactRefToJSONTyped, +} from './shared/reimbursementcontactref'; +import type { ReimbursableExpenseTransactionLine } from './shared/reimbursableexpensetransactionline'; +import { + ReimbursableExpenseTransactionLineFromJSON, + ReimbursableExpenseTransactionLineFromJSONTyped, + ReimbursableExpenseTransactionLineToJSON, + ReimbursableExpenseTransactionLineToJSONTyped, +} from './shared/reimbursableexpensetransactionline'; +import type { ApAccountRef } from './shared/apaccountref'; +import { + ApAccountRefFromJSON, + ApAccountRefFromJSONTyped, + ApAccountRefToJSON, + ApAccountRefToJSONTyped, +} from './shared/apaccountref'; + +/** + * + * @export + * @interface UpdateReimbursableExpenseTransactionRequest + */ +export interface UpdateReimbursableExpenseTransactionRequest { + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + lines?: Array; + companyId?: string; + transactionId?: string; + updateReimbursableExpenseTransactionRequest?: UpdateReimbursableExpenseTransactionRequest | undefined; +} + +/** + * Check if a given object implements the UpdateReimbursableExpenseTransactionRequest interface. + */ +export function instanceOfUpdateReimbursableExpenseTransactionRequest(value: object): value is UpdateReimbursableExpenseTransactionRequest { + if (!('contactRef' in value) || value['contactRef'] === undefined) return false; + if (!('issueDate' in value) || value['issueDate'] === undefined) return false; + if (!('dueDate' in value) || value['dueDate'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + return true; +} + +export function UpdateReimbursableExpenseTransactionRequestFromJSON(json: any): UpdateReimbursableExpenseTransactionRequest { + return UpdateReimbursableExpenseTransactionRequestFromJSONTyped(json, false); +} + +export function UpdateReimbursableExpenseTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateReimbursableExpenseTransactionRequest { + if (json == null) { + return json; + } + return { + + 'reference': json['reference'] == null ? undefined : json['reference'], + 'contactRef': ReimbursementContactRefFromJSON(json['contactRef']), + 'apAccountRef': json['apAccountRef'] == null ? undefined : ApAccountRefFromJSON(json['apAccountRef']), + 'issueDate': json['issueDate'], + 'dueDate': json['dueDate'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'notes': json['notes'] == null ? undefined : json['notes'], + 'lines': json['lines'] == null ? undefined : ((json['lines'] as Array).map(ReimbursableExpenseTransactionLineFromJSON)), + }; +} + +export function UpdateReimbursableExpenseTransactionRequestToJSON(json: any): UpdateReimbursableExpenseTransactionRequest { + return UpdateReimbursableExpenseTransactionRequestToJSONTyped(json, false); +} + +export function UpdateReimbursableExpenseTransactionRequestToJSONTyped(value?: UpdateReimbursableExpenseTransactionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'reference': value['reference'], + 'contactRef': ReimbursementContactRefToJSON(value['contactRef']), + 'apAccountRef': ApAccountRefToJSON(value['apAccountRef']), + 'issueDate': value['issueDate'], + 'dueDate': value['dueDate'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'notes': value['notes'], + 'lines': value['lines'] == null ? undefined : ((value['lines'] as Array).map(ReimbursableExpenseTransactionLineToJSON)), + }; +} + + +export interface ReimbursableExpenseTransactionUpdateRequestBody { + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + lines?: Array; + companyId?: string; + transactionId?: string; + updateReimbursableExpenseTransactionRequest?: UpdateReimbursableExpenseTransactionRequest | undefined; +} + +export interface UpdateReimbursableExpenseTransactionRequestBody { + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + lines?: Array; + companyId?: string; + transactionId?: string; + updateReimbursableExpenseTransactionRequest?: UpdateReimbursableExpenseTransactionRequest | undefined; +} + +export interface UpdateReimbursableExpenseTransactionRequestUpdatingReimbursableExpenseTransactionRequest { + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + lines?: Array; + companyId?: string; + transactionId?: string; + updateReimbursableExpenseTransactionRequest?: UpdateReimbursableExpenseTransactionRequest | undefined; +} + +export interface UpdateReimbursableExpenseTransactionUpdateReimbursableExpenseTransactionRequest { + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + lines?: Array; + companyId?: string; + transactionId?: string; + updateReimbursableExpenseTransactionRequest?: UpdateReimbursableExpenseTransactionRequest | undefined; +} + +export interface UpdatingReimbursableExpenseTransactionRequest { + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateReimbursableExpenseTransactionRequest + */ + lines?: Array; + companyId?: string; + transactionId?: string; + updateReimbursableExpenseTransactionRequest?: UpdateReimbursableExpenseTransactionRequest | undefined; +} diff --git a/sync-for-expenses/src/sdk/models/UpdateSupplierResponseAllOfData.ts b/sync-for-expenses/src/sdk/models/UpdateSupplierResponseAllOfData.ts new file mode 100644 index 000000000..106ce7c66 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/UpdateSupplierResponseAllOfData.ts @@ -0,0 +1,215 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../runtime'; +import type { SupplierStatus } from './shared/supplierstatus'; +import { + SupplierStatusFromJSON, + SupplierStatusFromJSONTyped, + SupplierStatusToJSON, + SupplierStatusToJSONTyped, +} from './shared/supplierstatus'; +import type { SupplementalData } from './shared/supplementaldata'; +import { + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './shared/supplementaldata'; +import type { Metadata } from './shared/metadata'; +import { + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './shared/metadata'; +import type { Items } from './shared/items'; +import { + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './shared/items'; + +/** + * + * @export + * @interface UpdateSupplierResponseAllOfData + */ +export interface UpdateSupplierResponseAllOfData { + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof UpdateSupplierResponseAllOfData + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof UpdateSupplierResponseAllOfData + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof UpdateSupplierResponseAllOfData + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof UpdateSupplierResponseAllOfData + */ + supplementalData?: SupplementalData; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof UpdateSupplierResponseAllOfData + */ + sourceModifiedDate?: string; +} + + + +/** + * Check if a given object implements the UpdateSupplierResponseAllOfData interface. + */ +export function instanceOfUpdateSupplierResponseAllOfData(value: object): value is UpdateSupplierResponseAllOfData { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function UpdateSupplierResponseAllOfDataFromJSON(json: any): UpdateSupplierResponseAllOfData { + return UpdateSupplierResponseAllOfDataFromJSONTyped(json, false); +} + +export function UpdateSupplierResponseAllOfDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateSupplierResponseAllOfData { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'supplierName': json['supplierName'] == null ? undefined : json['supplierName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(ItemsFromJSON)), + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'status': SupplierStatusFromJSON(json['status']), + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + }; +} + +export function UpdateSupplierResponseAllOfDataToJSON(json: any): UpdateSupplierResponseAllOfData { + return UpdateSupplierResponseAllOfDataToJSONTyped(json, false); +} + +export function UpdateSupplierResponseAllOfDataToJSONTyped(value?: UpdateSupplierResponseAllOfData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'supplierName': value['supplierName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(ItemsToJSON)), + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'status': SupplierStatusToJSON(value['status']), + 'defaultCurrency': value['defaultCurrency'], + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + }; +} + diff --git a/sync-for-expenses/src/sdk/models/_speakeasy_enums.ts b/sync-for-expenses/src/sdk/models/_speakeasy_enums.ts new file mode 100644 index 000000000..30d23241a --- /dev/null +++ b/sync-for-expenses/src/sdk/models/_speakeasy_enums.ts @@ -0,0 +1,6968 @@ +/* tslint:disable */ +/* eslint-disable */ + +export const AccountAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type AccountAccountType = (typeof AccountAccountType)[keyof typeof AccountAccountType]; +export const AccountBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountBankAccountStatus = (typeof AccountBankAccountStatus)[keyof typeof AccountBankAccountStatus]; +export const AccountMappingInfoAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", +} as const; +export type AccountMappingInfoAccountType = (typeof AccountMappingInfoAccountType)[keyof typeof AccountMappingInfoAccountType]; +export const AccountMappingInfoItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type AccountMappingInfoItems = (typeof AccountMappingInfoItems)[keyof typeof AccountMappingInfoItems]; +export const AccountMappingInfoItems1 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type AccountMappingInfoItems1 = (typeof AccountMappingInfoItems1)[keyof typeof AccountMappingInfoItems1]; +export const AccountMappingInfoItems2 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type AccountMappingInfoItems2 = (typeof AccountMappingInfoItems2)[keyof typeof AccountMappingInfoItems2]; +export const AccountMappingInfoValidFor = { + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type AccountMappingInfoValidFor = (typeof AccountMappingInfoValidFor)[keyof typeof AccountMappingInfoValidFor]; +export const AccountMappingInfoValidForItems = { + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type AccountMappingInfoValidForItems = (typeof AccountMappingInfoValidForItems)[keyof typeof AccountMappingInfoValidForItems]; +export const AccountMappingInfoValidTransactionTypes = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type AccountMappingInfoValidTransactionTypes = (typeof AccountMappingInfoValidTransactionTypes)[keyof typeof AccountMappingInfoValidTransactionTypes]; +export const AccountMappingInfoValidTransactionTypesItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type AccountMappingInfoValidTransactionTypesItems = (typeof AccountMappingInfoValidTransactionTypesItems)[keyof typeof AccountMappingInfoValidTransactionTypesItems]; +export const AccountPrototypeAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type AccountPrototypeAccountType = (typeof AccountPrototypeAccountType)[keyof typeof AccountPrototypeAccountType]; +export const AccountPrototypeBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountPrototypeBankAccountStatus = (typeof AccountPrototypeBankAccountStatus)[keyof typeof AccountPrototypeBankAccountStatus]; +export const AccountPrototypeStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountPrototypeStatusBankAccountStatus = (typeof AccountPrototypeStatusBankAccountStatus)[keyof typeof AccountPrototypeStatusBankAccountStatus]; +export const AccountPrototypeTypeAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type AccountPrototypeTypeAccountType = (typeof AccountPrototypeTypeAccountType)[keyof typeof AccountPrototypeTypeAccountType]; +export const AccountStatusAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountStatusAccountStatus = (typeof AccountStatusAccountStatus)[keyof typeof AccountStatusAccountStatus]; +export const AccountStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountStatusBankAccountStatus = (typeof AccountStatusBankAccountStatus)[keyof typeof AccountStatusBankAccountStatus]; +export const AccountType1 = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type AccountType1 = (typeof AccountType1)[keyof typeof AccountType1]; +export const AccountType2 = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type AccountType2 = (typeof AccountType2)[keyof typeof AccountType2]; +export const AccountTypeAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type AccountTypeAccountType = (typeof AccountTypeAccountType)[keyof typeof AccountTypeAccountType]; +export const AccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountTypeBankAccountType = (typeof AccountTypeBankAccountType)[keyof typeof AccountTypeBankAccountType]; +export const AccountingAddressTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type AccountingAddressTypeAccountingAddressType = (typeof AccountingAddressTypeAccountingAddressType)[keyof typeof AccountingAddressTypeAccountingAddressType]; +export const AccountingBankAccountsAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsAccountTypeBankAccountType = (typeof AccountingBankAccountsAccountTypeBankAccountType)[keyof typeof AccountingBankAccountsAccountTypeBankAccountType]; +export const AccountingBankAccountsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsBankAccountStatus = (typeof AccountingBankAccountsBankAccountStatus)[keyof typeof AccountingBankAccountsBankAccountStatus]; +export const AccountingBankAccountsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsBankAccountType = (typeof AccountingBankAccountsBankAccountType)[keyof typeof AccountingBankAccountsBankAccountType]; +export const AccountingBankAccountsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type AccountingBankAccountsDataTypeDataTypes = (typeof AccountingBankAccountsDataTypeDataTypes)[keyof typeof AccountingBankAccountsDataTypeDataTypes]; +export const AccountingBankAccountsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type AccountingBankAccountsDataTypes = (typeof AccountingBankAccountsDataTypes)[keyof typeof AccountingBankAccountsDataTypes]; +export const AccountingBankAccountsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsPushChangeType = (typeof AccountingBankAccountsPushChangeType)[keyof typeof AccountingBankAccountsPushChangeType]; +export const AccountingBankAccountsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type AccountingBankAccountsPushOperationStatus = (typeof AccountingBankAccountsPushOperationStatus)[keyof typeof AccountingBankAccountsPushOperationStatus]; +export const AccountingBankAccountsResultsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsResultsBankAccountStatus = (typeof AccountingBankAccountsResultsBankAccountStatus)[keyof typeof AccountingBankAccountsResultsBankAccountStatus]; +export const AccountingBankAccountsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsResultsPushChangeType = (typeof AccountingBankAccountsResultsPushChangeType)[keyof typeof AccountingBankAccountsResultsPushChangeType]; +export const AccountingBankAccountsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type AccountingBankAccountsResultsPushOperationStatus = (typeof AccountingBankAccountsResultsPushOperationStatus)[keyof typeof AccountingBankAccountsResultsPushOperationStatus]; +export const AccountingBankAccountsStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsStatusBankAccountStatus = (typeof AccountingBankAccountsStatusBankAccountStatus)[keyof typeof AccountingBankAccountsStatusBankAccountStatus]; +export const AccountingBankAccountsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type AccountingBankAccountsStatusPushOperationStatus = (typeof AccountingBankAccountsStatusPushOperationStatus)[keyof typeof AccountingBankAccountsStatusPushOperationStatus]; +export const AccountingBankAccountsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type AccountingBankAccountsTypePushChangeType = (typeof AccountingBankAccountsTypePushChangeType)[keyof typeof AccountingBankAccountsTypePushChangeType]; +export const AccountsAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", +} as const; +export type AccountsAccountType = (typeof AccountsAccountType)[keyof typeof AccountsAccountType]; +export const AddressAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type AddressAccountingAddressType = (typeof AddressAccountingAddressType)[keyof typeof AddressAccountingAddressType]; +export const AddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type AddressesAccountingAddressType = (typeof AddressesAccountingAddressType)[keyof typeof AddressesAccountingAddressType]; +export const AdjustmentTransactionLineDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type AdjustmentTransactionLineDataType = (typeof AdjustmentTransactionLineDataType)[keyof typeof AdjustmentTransactionLineDataType]; +export const AdjustmentTransactionLineInvoiceToType = { + Customer: "customer", +} as const; +export type AdjustmentTransactionLineInvoiceToType = (typeof AdjustmentTransactionLineInvoiceToType)[keyof typeof AdjustmentTransactionLineInvoiceToType]; +export const AdjustmentTransactionLineTrackingRefsDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type AdjustmentTransactionLineTrackingRefsDataType = (typeof AdjustmentTransactionLineTrackingRefsDataType)[keyof typeof AdjustmentTransactionLineTrackingRefsDataType]; +export const AdjustmentTransactionLineType = { + Customer: "customer", +} as const; +export type AdjustmentTransactionLineType = (typeof AdjustmentTransactionLineType)[keyof typeof AdjustmentTransactionLineType]; +export const AdjustmentTransactionRequestDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type AdjustmentTransactionRequestDataType = (typeof AdjustmentTransactionRequestDataType)[keyof typeof AdjustmentTransactionRequestDataType]; +export const AdjustmentTransactionRequestInvoiceToType = { + Customer: "customer", +} as const; +export type AdjustmentTransactionRequestInvoiceToType = (typeof AdjustmentTransactionRequestInvoiceToType)[keyof typeof AdjustmentTransactionRequestInvoiceToType]; +export const AdjustmentTransactionRequestTrackingRefsDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type AdjustmentTransactionRequestTrackingRefsDataType = (typeof AdjustmentTransactionRequestTrackingRefsDataType)[keyof typeof AdjustmentTransactionRequestTrackingRefsDataType]; +export const AdjustmentTransactionRequestType = { + Customer: "customer", +} as const; +export type AdjustmentTransactionRequestType = (typeof AdjustmentTransactionRequestType)[keyof typeof AdjustmentTransactionRequestType]; +export const BankAccountAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountAccountType = (typeof BankAccountAccountType)[keyof typeof BankAccountAccountType]; +export const BankAccountAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountAccountTypeBankAccountType = (typeof BankAccountAccountTypeBankAccountType)[keyof typeof BankAccountAccountTypeBankAccountType]; +export const BankAccountBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountBankAccountStatus = (typeof BankAccountBankAccountStatus)[keyof typeof BankAccountBankAccountStatus]; +export const BankAccountBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountBankAccountType = (typeof BankAccountBankAccountType)[keyof typeof BankAccountBankAccountType]; +export const BankAccountCreateResponseAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseAccountTypeBankAccountType = (typeof BankAccountCreateResponseAccountTypeBankAccountType)[keyof typeof BankAccountCreateResponseAccountTypeBankAccountType]; +export const BankAccountCreateResponseBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseBankAccountStatus = (typeof BankAccountCreateResponseBankAccountStatus)[keyof typeof BankAccountCreateResponseBankAccountStatus]; +export const BankAccountCreateResponseBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseBankAccountType = (typeof BankAccountCreateResponseBankAccountType)[keyof typeof BankAccountCreateResponseBankAccountType]; +export const BankAccountCreateResponseDataBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseDataBankAccountStatus = (typeof BankAccountCreateResponseDataBankAccountStatus)[keyof typeof BankAccountCreateResponseDataBankAccountStatus]; +export const BankAccountCreateResponseDataPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseDataPushChangeType = (typeof BankAccountCreateResponseDataPushChangeType)[keyof typeof BankAccountCreateResponseDataPushChangeType]; +export const BankAccountCreateResponseDataPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountCreateResponseDataPushOperationStatus = (typeof BankAccountCreateResponseDataPushOperationStatus)[keyof typeof BankAccountCreateResponseDataPushOperationStatus]; +export const BankAccountCreateResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountCreateResponseDataTypeDataTypes = (typeof BankAccountCreateResponseDataTypeDataTypes)[keyof typeof BankAccountCreateResponseDataTypeDataTypes]; +export const BankAccountCreateResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountCreateResponseDataTypes = (typeof BankAccountCreateResponseDataTypes)[keyof typeof BankAccountCreateResponseDataTypes]; +export const BankAccountCreateResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponsePushChangeType = (typeof BankAccountCreateResponsePushChangeType)[keyof typeof BankAccountCreateResponsePushChangeType]; +export const BankAccountCreateResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountCreateResponsePushOperationStatus = (typeof BankAccountCreateResponsePushOperationStatus)[keyof typeof BankAccountCreateResponsePushOperationStatus]; +export const BankAccountCreateResponseStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseStatusBankAccountStatus = (typeof BankAccountCreateResponseStatusBankAccountStatus)[keyof typeof BankAccountCreateResponseStatusBankAccountStatus]; +export const BankAccountCreateResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountCreateResponseStatusPushOperationStatus = (typeof BankAccountCreateResponseStatusPushOperationStatus)[keyof typeof BankAccountCreateResponseStatusPushOperationStatus]; +export const BankAccountCreateResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountCreateResponseTypePushChangeType = (typeof BankAccountCreateResponseTypePushChangeType)[keyof typeof BankAccountCreateResponseTypePushChangeType]; +export const BankAccountDataBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountDataBankAccountStatus = (typeof BankAccountDataBankAccountStatus)[keyof typeof BankAccountDataBankAccountStatus]; +export const BankAccountDataPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountDataPushChangeType = (typeof BankAccountDataPushChangeType)[keyof typeof BankAccountDataPushChangeType]; +export const BankAccountDataPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountDataPushOperationStatus = (typeof BankAccountDataPushOperationStatus)[keyof typeof BankAccountDataPushOperationStatus]; +export const BankAccountDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountDataTypeDataTypes = (typeof BankAccountDataTypeDataTypes)[keyof typeof BankAccountDataTypeDataTypes]; +export const BankAccountDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountDataTypes = (typeof BankAccountDataTypes)[keyof typeof BankAccountDataTypes]; +export const BankAccountPrototypeAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeAccountType = (typeof BankAccountPrototypeAccountType)[keyof typeof BankAccountPrototypeAccountType]; +export const BankAccountPrototypeAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeAccountTypeBankAccountType = (typeof BankAccountPrototypeAccountTypeBankAccountType)[keyof typeof BankAccountPrototypeAccountTypeBankAccountType]; +export const BankAccountPrototypeBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeBankAccountStatus = (typeof BankAccountPrototypeBankAccountStatus)[keyof typeof BankAccountPrototypeBankAccountStatus]; +export const BankAccountPrototypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeBankAccountType = (typeof BankAccountPrototypeBankAccountType)[keyof typeof BankAccountPrototypeBankAccountType]; +export const BankAccountPrototypeStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountPrototypeStatusBankAccountStatus = (typeof BankAccountPrototypeStatusBankAccountStatus)[keyof typeof BankAccountPrototypeStatusBankAccountStatus]; +export const BankAccountPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountPushChangeType = (typeof BankAccountPushChangeType)[keyof typeof BankAccountPushChangeType]; +export const BankAccountPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountPushOperationStatus = (typeof BankAccountPushOperationStatus)[keyof typeof BankAccountPushOperationStatus]; +export const BankAccountResultsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountResultsBankAccountStatus = (typeof BankAccountResultsBankAccountStatus)[keyof typeof BankAccountResultsBankAccountStatus]; +export const BankAccountResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountResultsPushChangeType = (typeof BankAccountResultsPushChangeType)[keyof typeof BankAccountResultsPushChangeType]; +export const BankAccountResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountResultsPushOperationStatus = (typeof BankAccountResultsPushOperationStatus)[keyof typeof BankAccountResultsPushOperationStatus]; +export const BankAccountStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountStatusBankAccountStatus = (typeof BankAccountStatusBankAccountStatus)[keyof typeof BankAccountStatusBankAccountStatus]; +export const BankAccountStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountStatusPushOperationStatus = (typeof BankAccountStatusPushOperationStatus)[keyof typeof BankAccountStatusPushOperationStatus]; +export const BankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountType = (typeof BankAccountType)[keyof typeof BankAccountType]; +export const BankAccountTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountTypePushChangeType = (typeof BankAccountTypePushChangeType)[keyof typeof BankAccountTypePushChangeType]; +export const BankAccountsAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountsAccountTypeBankAccountType = (typeof BankAccountsAccountTypeBankAccountType)[keyof typeof BankAccountsAccountTypeBankAccountType]; +export const BankAccountsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountsBankAccountStatus = (typeof BankAccountsBankAccountStatus)[keyof typeof BankAccountsBankAccountStatus]; +export const BankAccountsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type BankAccountsBankAccountType = (typeof BankAccountsBankAccountType)[keyof typeof BankAccountsBankAccountType]; +export const BankAccountsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountsDataTypeDataTypes = (typeof BankAccountsDataTypeDataTypes)[keyof typeof BankAccountsDataTypeDataTypes]; +export const BankAccountsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type BankAccountsDataTypes = (typeof BankAccountsDataTypes)[keyof typeof BankAccountsDataTypes]; +export const BankAccountsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountsPushChangeType = (typeof BankAccountsPushChangeType)[keyof typeof BankAccountsPushChangeType]; +export const BankAccountsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountsPushOperationStatus = (typeof BankAccountsPushOperationStatus)[keyof typeof BankAccountsPushOperationStatus]; +export const BankAccountsResultsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountsResultsBankAccountStatus = (typeof BankAccountsResultsBankAccountStatus)[keyof typeof BankAccountsResultsBankAccountStatus]; +export const BankAccountsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountsResultsPushChangeType = (typeof BankAccountsResultsPushChangeType)[keyof typeof BankAccountsResultsPushChangeType]; +export const BankAccountsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountsResultsPushOperationStatus = (typeof BankAccountsResultsPushOperationStatus)[keyof typeof BankAccountsResultsPushOperationStatus]; +export const BankAccountsStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type BankAccountsStatusBankAccountStatus = (typeof BankAccountsStatusBankAccountStatus)[keyof typeof BankAccountsStatusBankAccountStatus]; +export const BankAccountsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type BankAccountsStatusPushOperationStatus = (typeof BankAccountsStatusPushOperationStatus)[keyof typeof BankAccountsStatusPushOperationStatus]; +export const BankAccountsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type BankAccountsTypePushChangeType = (typeof BankAccountsTypePushChangeType)[keyof typeof BankAccountsTypePushChangeType]; +export const CompaniesDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionSourceType = (typeof CompaniesDataConnectionSourceType)[keyof typeof CompaniesDataConnectionSourceType]; +export const CompaniesDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionStatus = (typeof CompaniesDataConnectionStatus)[keyof typeof CompaniesDataConnectionStatus]; +export const CompaniesDataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesDataConnectionsDataConnectionSourceType = (typeof CompaniesDataConnectionsDataConnectionSourceType)[keyof typeof CompaniesDataConnectionsDataConnectionSourceType]; +export const CompaniesDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesDataConnectionsDataConnectionStatus = (typeof CompaniesDataConnectionsDataConnectionStatus)[keyof typeof CompaniesDataConnectionsDataConnectionStatus]; +export const CompaniesErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesErrorStatus = (typeof CompaniesErrorStatus)[keyof typeof CompaniesErrorStatus]; +export const CompaniesSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompaniesSourceTypeDataConnectionSourceType = (typeof CompaniesSourceTypeDataConnectionSourceType)[keyof typeof CompaniesSourceTypeDataConnectionSourceType]; +export const CompaniesStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompaniesStatusDataConnectionStatus = (typeof CompaniesStatusDataConnectionStatus)[keyof typeof CompaniesStatusDataConnectionStatus]; +export const CompaniesStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompaniesStatusErrorStatus = (typeof CompaniesStatusErrorStatus)[keyof typeof CompaniesStatusErrorStatus]; +export const CompanyDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionSourceType = (typeof CompanyDataConnectionSourceType)[keyof typeof CompanyDataConnectionSourceType]; +export const CompanyDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionStatus = (typeof CompanyDataConnectionStatus)[keyof typeof CompanyDataConnectionStatus]; +export const CompanyDataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanyDataConnectionsDataConnectionSourceType = (typeof CompanyDataConnectionsDataConnectionSourceType)[keyof typeof CompanyDataConnectionsDataConnectionSourceType]; +export const CompanyDataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyDataConnectionsDataConnectionStatus = (typeof CompanyDataConnectionsDataConnectionStatus)[keyof typeof CompanyDataConnectionsDataConnectionStatus]; +export const CompanyErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyErrorStatus = (typeof CompanyErrorStatus)[keyof typeof CompanyErrorStatus]; +export const CompanyInformationAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CompanyInformationAccountingAddressType = (typeof CompanyInformationAccountingAddressType)[keyof typeof CompanyInformationAccountingAddressType]; +export const CompanyInformationAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CompanyInformationAddressesAccountingAddressType = (typeof CompanyInformationAddressesAccountingAddressType)[keyof typeof CompanyInformationAddressesAccountingAddressType]; +export const CompanyInformationPhoneNumbersType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CompanyInformationPhoneNumbersType = (typeof CompanyInformationPhoneNumbersType)[keyof typeof CompanyInformationPhoneNumbersType]; +export const CompanyInformationType = { + Social: "Social", + Unknown: "Unknown", + Website: "Website", +} as const; +export type CompanyInformationType = (typeof CompanyInformationType)[keyof typeof CompanyInformationType]; +export const CompanyInformationType1 = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Social: "Social", + Unknown: "Unknown", + Website: "Website", +} as const; +export type CompanyInformationType1 = (typeof CompanyInformationType1)[keyof typeof CompanyInformationType1]; +export const CompanyInformationType2 = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Social: "Social", + Unknown: "Unknown", + Website: "Website", +} as const; +export type CompanyInformationType2 = (typeof CompanyInformationType2)[keyof typeof CompanyInformationType2]; +export const CompanyInformationTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CompanyInformationTypeAccountingAddressType = (typeof CompanyInformationTypeAccountingAddressType)[keyof typeof CompanyInformationTypeAccountingAddressType]; +export const CompanyInformationWebLinksType = { + Social: "Social", + Unknown: "Unknown", + Website: "Website", +} as const; +export type CompanyInformationWebLinksType = (typeof CompanyInformationWebLinksType)[keyof typeof CompanyInformationWebLinksType]; +export const CompanySourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type CompanySourceTypeDataConnectionSourceType = (typeof CompanySourceTypeDataConnectionSourceType)[keyof typeof CompanySourceTypeDataConnectionSourceType]; +export const CompanyStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type CompanyStatusDataConnectionStatus = (typeof CompanyStatusDataConnectionStatus)[keyof typeof CompanyStatusDataConnectionStatus]; +export const CompanyStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type CompanyStatusErrorStatus = (typeof CompanyStatusErrorStatus)[keyof typeof CompanyStatusErrorStatus]; +export const ConnectionDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionDataConnectionSourceType = (typeof ConnectionDataConnectionSourceType)[keyof typeof ConnectionDataConnectionSourceType]; +export const ConnectionDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionDataConnectionStatus = (typeof ConnectionDataConnectionStatus)[keyof typeof ConnectionDataConnectionStatus]; +export const ConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionErrorStatus = (typeof ConnectionErrorStatus)[keyof typeof ConnectionErrorStatus]; +export const ConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceType = (typeof ConnectionSourceType)[keyof typeof ConnectionSourceType]; +export const ConnectionSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionSourceTypeDataConnectionSourceType = (typeof ConnectionSourceTypeDataConnectionSourceType)[keyof typeof ConnectionSourceTypeDataConnectionSourceType]; +export const ConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionStatusDataConnectionStatus = (typeof ConnectionStatusDataConnectionStatus)[keyof typeof ConnectionStatusDataConnectionStatus]; +export const ConnectionStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionStatusErrorStatus = (typeof ConnectionStatusErrorStatus)[keyof typeof ConnectionStatusErrorStatus]; +export const ConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsDataConnectionSourceType = (typeof ConnectionsDataConnectionSourceType)[keyof typeof ConnectionsDataConnectionSourceType]; +export const ConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsDataConnectionStatus = (typeof ConnectionsDataConnectionStatus)[keyof typeof ConnectionsDataConnectionStatus]; +export const ConnectionsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsErrorStatus = (typeof ConnectionsErrorStatus)[keyof typeof ConnectionsErrorStatus]; +export const ConnectionsResultsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsResultsDataConnectionSourceType = (typeof ConnectionsResultsDataConnectionSourceType)[keyof typeof ConnectionsResultsDataConnectionSourceType]; +export const ConnectionsResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsResultsDataConnectionStatus = (typeof ConnectionsResultsDataConnectionStatus)[keyof typeof ConnectionsResultsDataConnectionStatus]; +export const ConnectionsSourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ConnectionsSourceTypeDataConnectionSourceType = (typeof ConnectionsSourceTypeDataConnectionSourceType)[keyof typeof ConnectionsSourceTypeDataConnectionSourceType]; +export const ConnectionsStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ConnectionsStatusDataConnectionStatus = (typeof ConnectionsStatusDataConnectionStatus)[keyof typeof ConnectionsStatusDataConnectionStatus]; +export const ConnectionsStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ConnectionsStatusErrorStatus = (typeof ConnectionsStatusErrorStatus)[keyof typeof ConnectionsStatusErrorStatus]; +export const ContactAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type ContactAccountingAddressType = (typeof ContactAccountingAddressType)[keyof typeof ContactAccountingAddressType]; +export const ContactAddressAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type ContactAddressAccountingAddressType = (typeof ContactAddressAccountingAddressType)[keyof typeof ContactAddressAccountingAddressType]; +export const ContactPhoneType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type ContactPhoneType = (typeof ContactPhoneType)[keyof typeof ContactPhoneType]; +export const ContactRefType = { + Supplier: "Supplier", +} as const; +export type ContactRefType = (typeof ContactRefType)[keyof typeof ContactRefType]; +export const ContactStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ContactStatusSupplierStatus = (typeof ContactStatusSupplierStatus)[keyof typeof ContactStatusSupplierStatus]; +export const ContactSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ContactSupplierStatus = (typeof ContactSupplierStatus)[keyof typeof ContactSupplierStatus]; +export const ContactType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type ContactType = (typeof ContactType)[keyof typeof ContactType]; +export const ContactTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type ContactTypeAccountingAddressType = (typeof ContactTypeAccountingAddressType)[keyof typeof ContactTypeAccountingAddressType]; +export const CreateAccountResponseAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseAccountType = (typeof CreateAccountResponseAccountType)[keyof typeof CreateAccountResponseAccountType]; +export const CreateAccountResponseBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseBankAccountStatus = (typeof CreateAccountResponseBankAccountStatus)[keyof typeof CreateAccountResponseBankAccountStatus]; +export const CreateAccountResponseDataAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseDataAccountType = (typeof CreateAccountResponseDataAccountType)[keyof typeof CreateAccountResponseDataAccountType]; +export const CreateAccountResponseDataBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseDataBankAccountStatus = (typeof CreateAccountResponseDataBankAccountStatus)[keyof typeof CreateAccountResponseDataBankAccountStatus]; +export const CreateAccountResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateAccountResponseDataType = (typeof CreateAccountResponseDataType)[keyof typeof CreateAccountResponseDataType]; +export const CreateAccountResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateAccountResponseDataTypeDataTypes = (typeof CreateAccountResponseDataTypeDataTypes)[keyof typeof CreateAccountResponseDataTypeDataTypes]; +export const CreateAccountResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateAccountResponseDataTypes = (typeof CreateAccountResponseDataTypes)[keyof typeof CreateAccountResponseDataTypes]; +export const CreateAccountResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateAccountResponsePushChangeType = (typeof CreateAccountResponsePushChangeType)[keyof typeof CreateAccountResponsePushChangeType]; +export const CreateAccountResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateAccountResponsePushOperationStatus = (typeof CreateAccountResponsePushOperationStatus)[keyof typeof CreateAccountResponsePushOperationStatus]; +export const CreateAccountResponseStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseStatusBankAccountStatus = (typeof CreateAccountResponseStatusBankAccountStatus)[keyof typeof CreateAccountResponseStatusBankAccountStatus]; +export const CreateAccountResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateAccountResponseStatusPushOperationStatus = (typeof CreateAccountResponseStatusPushOperationStatus)[keyof typeof CreateAccountResponseStatusPushOperationStatus]; +export const CreateAccountResponseTypeAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseTypeAccountType = (typeof CreateAccountResponseTypeAccountType)[keyof typeof CreateAccountResponseTypeAccountType]; +export const CreateAccountResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateAccountResponseTypePushChangeType = (typeof CreateAccountResponseTypePushChangeType)[keyof typeof CreateAccountResponseTypePushChangeType]; +export const CreateAdjustmentRequestDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type CreateAdjustmentRequestDataType = (typeof CreateAdjustmentRequestDataType)[keyof typeof CreateAdjustmentRequestDataType]; +export const CreateAdjustmentRequestInvoiceToType = { + Customer: "customer", +} as const; +export type CreateAdjustmentRequestInvoiceToType = (typeof CreateAdjustmentRequestInvoiceToType)[keyof typeof CreateAdjustmentRequestInvoiceToType]; +export const CreateAdjustmentRequestTrackingRefsDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type CreateAdjustmentRequestTrackingRefsDataType = (typeof CreateAdjustmentRequestTrackingRefsDataType)[keyof typeof CreateAdjustmentRequestTrackingRefsDataType]; +export const CreateAdjustmentRequestType = { + Customer: "customer", +} as const; +export type CreateAdjustmentRequestType = (typeof CreateAdjustmentRequestType)[keyof typeof CreateAdjustmentRequestType]; +export const CreateBankAccountResponseAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseAccountType = (typeof CreateBankAccountResponseAccountType)[keyof typeof CreateBankAccountResponseAccountType]; +export const CreateBankAccountResponseAccountTypeBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseAccountTypeBankAccountType = (typeof CreateBankAccountResponseAccountTypeBankAccountType)[keyof typeof CreateBankAccountResponseAccountTypeBankAccountType]; +export const CreateBankAccountResponseBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseBankAccountStatus = (typeof CreateBankAccountResponseBankAccountStatus)[keyof typeof CreateBankAccountResponseBankAccountStatus]; +export const CreateBankAccountResponseBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseBankAccountType = (typeof CreateBankAccountResponseBankAccountType)[keyof typeof CreateBankAccountResponseBankAccountType]; +export const CreateBankAccountResponseDataBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseDataBankAccountStatus = (typeof CreateBankAccountResponseDataBankAccountStatus)[keyof typeof CreateBankAccountResponseDataBankAccountStatus]; +export const CreateBankAccountResponseDataPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseDataPushChangeType = (typeof CreateBankAccountResponseDataPushChangeType)[keyof typeof CreateBankAccountResponseDataPushChangeType]; +export const CreateBankAccountResponseDataPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankAccountResponseDataPushOperationStatus = (typeof CreateBankAccountResponseDataPushOperationStatus)[keyof typeof CreateBankAccountResponseDataPushOperationStatus]; +export const CreateBankAccountResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankAccountResponseDataType = (typeof CreateBankAccountResponseDataType)[keyof typeof CreateBankAccountResponseDataType]; +export const CreateBankAccountResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankAccountResponseDataTypeDataTypes = (typeof CreateBankAccountResponseDataTypeDataTypes)[keyof typeof CreateBankAccountResponseDataTypeDataTypes]; +export const CreateBankAccountResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateBankAccountResponseDataTypes = (typeof CreateBankAccountResponseDataTypes)[keyof typeof CreateBankAccountResponseDataTypes]; +export const CreateBankAccountResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponsePushChangeType = (typeof CreateBankAccountResponsePushChangeType)[keyof typeof CreateBankAccountResponsePushChangeType]; +export const CreateBankAccountResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankAccountResponsePushOperationStatus = (typeof CreateBankAccountResponsePushOperationStatus)[keyof typeof CreateBankAccountResponsePushOperationStatus]; +export const CreateBankAccountResponseStatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseStatusBankAccountStatus = (typeof CreateBankAccountResponseStatusBankAccountStatus)[keyof typeof CreateBankAccountResponseStatusBankAccountStatus]; +export const CreateBankAccountResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateBankAccountResponseStatusPushOperationStatus = (typeof CreateBankAccountResponseStatusPushOperationStatus)[keyof typeof CreateBankAccountResponseStatusPushOperationStatus]; +export const CreateBankAccountResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateBankAccountResponseTypePushChangeType = (typeof CreateBankAccountResponseTypePushChangeType)[keyof typeof CreateBankAccountResponseTypePushChangeType]; +export const CreateCustomerResponseAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseAccountingAddressType = (typeof CreateCustomerResponseAccountingAddressType)[keyof typeof CreateCustomerResponseAccountingAddressType]; +export const CreateCustomerResponseAddressAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseAddressAccountingAddressType = (typeof CreateCustomerResponseAddressAccountingAddressType)[keyof typeof CreateCustomerResponseAddressAccountingAddressType]; +export const CreateCustomerResponseAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseAddressesAccountingAddressType = (typeof CreateCustomerResponseAddressesAccountingAddressType)[keyof typeof CreateCustomerResponseAddressesAccountingAddressType]; +export const CreateCustomerResponseDataSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseDataSupplierStatus = (typeof CreateCustomerResponseDataSupplierStatus)[keyof typeof CreateCustomerResponseDataSupplierStatus]; +export const CreateCustomerResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateCustomerResponseDataType = (typeof CreateCustomerResponseDataType)[keyof typeof CreateCustomerResponseDataType]; +export const CreateCustomerResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateCustomerResponseDataTypeDataTypes = (typeof CreateCustomerResponseDataTypeDataTypes)[keyof typeof CreateCustomerResponseDataTypeDataTypes]; +export const CreateCustomerResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateCustomerResponseDataTypes = (typeof CreateCustomerResponseDataTypes)[keyof typeof CreateCustomerResponseDataTypes]; +export const CreateCustomerResponsePhoneType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponsePhoneType = (typeof CreateCustomerResponsePhoneType)[keyof typeof CreateCustomerResponsePhoneType]; +export const CreateCustomerResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponsePushChangeType = (typeof CreateCustomerResponsePushChangeType)[keyof typeof CreateCustomerResponsePushChangeType]; +export const CreateCustomerResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateCustomerResponsePushOperationStatus = (typeof CreateCustomerResponsePushOperationStatus)[keyof typeof CreateCustomerResponsePushOperationStatus]; +export const CreateCustomerResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateCustomerResponseStatusPushOperationStatus = (typeof CreateCustomerResponseStatusPushOperationStatus)[keyof typeof CreateCustomerResponseStatusPushOperationStatus]; +export const CreateCustomerResponseStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseStatusSupplierStatus = (typeof CreateCustomerResponseStatusSupplierStatus)[keyof typeof CreateCustomerResponseStatusSupplierStatus]; +export const CreateCustomerResponseSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseSupplierStatus = (typeof CreateCustomerResponseSupplierStatus)[keyof typeof CreateCustomerResponseSupplierStatus]; +export const CreateCustomerResponseType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseType = (typeof CreateCustomerResponseType)[keyof typeof CreateCustomerResponseType]; +export const CreateCustomerResponseTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseTypeAccountingAddressType = (typeof CreateCustomerResponseTypeAccountingAddressType)[keyof typeof CreateCustomerResponseTypeAccountingAddressType]; +export const CreateCustomerResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateCustomerResponseTypePushChangeType = (typeof CreateCustomerResponseTypePushChangeType)[keyof typeof CreateCustomerResponseTypePushChangeType]; +export const CreateExpenseRequestContactRefType = { + Supplier: "Supplier", +} as const; +export type CreateExpenseRequestContactRefType = (typeof CreateExpenseRequestContactRefType)[keyof typeof CreateExpenseRequestContactRefType]; +export const CreateExpenseRequestDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type CreateExpenseRequestDataType = (typeof CreateExpenseRequestDataType)[keyof typeof CreateExpenseRequestDataType]; +export const CreateExpenseRequestInvoiceToType = { + Customer: "customer", +} as const; +export type CreateExpenseRequestInvoiceToType = (typeof CreateExpenseRequestInvoiceToType)[keyof typeof CreateExpenseRequestInvoiceToType]; +export const CreateExpenseRequestItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type CreateExpenseRequestItems = (typeof CreateExpenseRequestItems)[keyof typeof CreateExpenseRequestItems]; +export const CreateExpenseRequestTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type CreateExpenseRequestTrackingRefsDataType = (typeof CreateExpenseRequestTrackingRefsDataType)[keyof typeof CreateExpenseRequestTrackingRefsDataType]; +export const CreateExpenseRequestType = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type CreateExpenseRequestType = (typeof CreateExpenseRequestType)[keyof typeof CreateExpenseRequestType]; +export const CreateExpenseRequestType1 = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type CreateExpenseRequestType1 = (typeof CreateExpenseRequestType1)[keyof typeof CreateExpenseRequestType1]; +export const CreateExpenseRequestType2 = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type CreateExpenseRequestType2 = (typeof CreateExpenseRequestType2)[keyof typeof CreateExpenseRequestType2]; +export const CreateExpenseRequestTypeItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type CreateExpenseRequestTypeItems = (typeof CreateExpenseRequestTypeItems)[keyof typeof CreateExpenseRequestTypeItems]; +export const CreateSupplierResponseAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseAccountingAddressType = (typeof CreateSupplierResponseAccountingAddressType)[keyof typeof CreateSupplierResponseAccountingAddressType]; +export const CreateSupplierResponseAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseAddressesAccountingAddressType = (typeof CreateSupplierResponseAddressesAccountingAddressType)[keyof typeof CreateSupplierResponseAddressesAccountingAddressType]; +export const CreateSupplierResponseDataSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseDataSupplierStatus = (typeof CreateSupplierResponseDataSupplierStatus)[keyof typeof CreateSupplierResponseDataSupplierStatus]; +export const CreateSupplierResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateSupplierResponseDataType = (typeof CreateSupplierResponseDataType)[keyof typeof CreateSupplierResponseDataType]; +export const CreateSupplierResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateSupplierResponseDataTypeDataTypes = (typeof CreateSupplierResponseDataTypeDataTypes)[keyof typeof CreateSupplierResponseDataTypeDataTypes]; +export const CreateSupplierResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type CreateSupplierResponseDataTypes = (typeof CreateSupplierResponseDataTypes)[keyof typeof CreateSupplierResponseDataTypes]; +export const CreateSupplierResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponsePushChangeType = (typeof CreateSupplierResponsePushChangeType)[keyof typeof CreateSupplierResponsePushChangeType]; +export const CreateSupplierResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateSupplierResponsePushOperationStatus = (typeof CreateSupplierResponsePushOperationStatus)[keyof typeof CreateSupplierResponsePushOperationStatus]; +export const CreateSupplierResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type CreateSupplierResponseStatusPushOperationStatus = (typeof CreateSupplierResponseStatusPushOperationStatus)[keyof typeof CreateSupplierResponseStatusPushOperationStatus]; +export const CreateSupplierResponseStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseStatusSupplierStatus = (typeof CreateSupplierResponseStatusSupplierStatus)[keyof typeof CreateSupplierResponseStatusSupplierStatus]; +export const CreateSupplierResponseSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseSupplierStatus = (typeof CreateSupplierResponseSupplierStatus)[keyof typeof CreateSupplierResponseSupplierStatus]; +export const CreateSupplierResponseTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseTypeAccountingAddressType = (typeof CreateSupplierResponseTypeAccountingAddressType)[keyof typeof CreateSupplierResponseTypeAccountingAddressType]; +export const CreateSupplierResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type CreateSupplierResponseTypePushChangeType = (typeof CreateSupplierResponseTypePushChangeType)[keyof typeof CreateSupplierResponseTypePushChangeType]; +export const CurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CurrentStatus = (typeof CurrentStatus)[keyof typeof CurrentStatus]; +export const CurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type CurrentStatusDatasetStatus = (typeof CurrentStatusDatasetStatus)[keyof typeof CurrentStatusDatasetStatus]; +export const CustomerAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomerAccountingAddressType = (typeof CustomerAccountingAddressType)[keyof typeof CustomerAccountingAddressType]; +export const CustomerAddressAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomerAddressAccountingAddressType = (typeof CustomerAddressAccountingAddressType)[keyof typeof CustomerAddressAccountingAddressType]; +export const CustomerAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomerAddressesAccountingAddressType = (typeof CustomerAddressesAccountingAddressType)[keyof typeof CustomerAddressesAccountingAddressType]; +export const CustomerPhoneType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CustomerPhoneType = (typeof CustomerPhoneType)[keyof typeof CustomerPhoneType]; +export const CustomerStatusCustomerStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CustomerStatusCustomerStatus = (typeof CustomerStatusCustomerStatus)[keyof typeof CustomerStatusCustomerStatus]; +export const CustomerStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CustomerStatusSupplierStatus = (typeof CustomerStatusSupplierStatus)[keyof typeof CustomerStatusSupplierStatus]; +export const CustomerSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CustomerSupplierStatus = (typeof CustomerSupplierStatus)[keyof typeof CustomerSupplierStatus]; +export const CustomerType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CustomerType = (typeof CustomerType)[keyof typeof CustomerType]; +export const CustomerTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomerTypeAccountingAddressType = (typeof CustomerTypeAccountingAddressType)[keyof typeof CustomerTypeAccountingAddressType]; +export const CustomersAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomersAccountingAddressType = (typeof CustomersAccountingAddressType)[keyof typeof CustomersAccountingAddressType]; +export const CustomersAddressAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomersAddressAccountingAddressType = (typeof CustomersAddressAccountingAddressType)[keyof typeof CustomersAddressAccountingAddressType]; +export const CustomersAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomersAddressesAccountingAddressType = (typeof CustomersAddressesAccountingAddressType)[keyof typeof CustomersAddressesAccountingAddressType]; +export const CustomersPhoneType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CustomersPhoneType = (typeof CustomersPhoneType)[keyof typeof CustomersPhoneType]; +export const CustomersResultsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CustomersResultsSupplierStatus = (typeof CustomersResultsSupplierStatus)[keyof typeof CustomersResultsSupplierStatus]; +export const CustomersStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CustomersStatusSupplierStatus = (typeof CustomersStatusSupplierStatus)[keyof typeof CustomersStatusSupplierStatus]; +export const CustomersSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type CustomersSupplierStatus = (typeof CustomersSupplierStatus)[keyof typeof CustomersSupplierStatus]; +export const CustomersType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type CustomersType = (typeof CustomersType)[keyof typeof CustomersType]; +export const CustomersTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type CustomersTypeAccountingAddressType = (typeof CustomersTypeAccountingAddressType)[keyof typeof CustomersTypeAccountingAddressType]; +export const DataAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type DataAccountType = (typeof DataAccountType)[keyof typeof DataAccountType]; +export const DataBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type DataBankAccountStatus = (typeof DataBankAccountStatus)[keyof typeof DataBankAccountStatus]; +export const DataConnectionErrorErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorErrorStatus = (typeof DataConnectionErrorErrorStatus)[keyof typeof DataConnectionErrorErrorStatus]; +export const DataConnectionErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatus = (typeof DataConnectionErrorStatus)[keyof typeof DataConnectionErrorStatus]; +export const DataConnectionErrorStatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type DataConnectionErrorStatusErrorStatus = (typeof DataConnectionErrorStatusErrorStatus)[keyof typeof DataConnectionErrorStatusErrorStatus]; +export const DataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionSourceType = (typeof DataConnectionSourceType)[keyof typeof DataConnectionSourceType]; +export const DataConnectionStatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionStatusDataConnectionStatus = (typeof DataConnectionStatusDataConnectionStatus)[keyof typeof DataConnectionStatusDataConnectionStatus]; +export const DataConnectionsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type DataConnectionsDataConnectionSourceType = (typeof DataConnectionsDataConnectionSourceType)[keyof typeof DataConnectionsDataConnectionSourceType]; +export const DataConnectionsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type DataConnectionsDataConnectionStatus = (typeof DataConnectionsDataConnectionStatus)[keyof typeof DataConnectionsDataConnectionStatus]; +export const DataPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type DataPushChangeType = (typeof DataPushChangeType)[keyof typeof DataPushChangeType]; +export const DataPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type DataPushOperationStatus = (typeof DataPushOperationStatus)[keyof typeof DataPushOperationStatus]; +export const DataStatusCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusCurrentStatus = (typeof DataStatusCurrentStatus)[keyof typeof DataStatusCurrentStatus]; +export const DataStatusCurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusCurrentStatusDatasetStatus = (typeof DataStatusCurrentStatusDatasetStatus)[keyof typeof DataStatusCurrentStatusDatasetStatus]; +export const DataStatusDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataType = (typeof DataStatusDataType)[keyof typeof DataStatusDataType]; +export const DataStatusDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataTypeDataTypes = (typeof DataStatusDataTypeDataTypes)[keyof typeof DataStatusDataTypeDataTypes]; +export const DataStatusDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusDataTypes = (typeof DataStatusDataTypes)[keyof typeof DataStatusDataTypes]; +export const DataStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusDatasetStatus = (typeof DataStatusDatasetStatus)[keyof typeof DataStatusDatasetStatus]; +export const DataStatusResponseCurrentStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusResponseCurrentStatusDatasetStatus = (typeof DataStatusResponseCurrentStatusDatasetStatus)[keyof typeof DataStatusResponseCurrentStatusDatasetStatus]; +export const DataStatusResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusResponseDataTypeDataTypes = (typeof DataStatusResponseDataTypeDataTypes)[keyof typeof DataStatusResponseDataTypeDataTypes]; +export const DataStatusResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataStatusResponseDataTypes = (typeof DataStatusResponseDataTypes)[keyof typeof DataStatusResponseDataTypes]; +export const DataStatusResponseDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DataStatusResponseDatasetStatus = (typeof DataStatusResponseDatasetStatus)[keyof typeof DataStatusResponseDatasetStatus]; +export const DataSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type DataSupplierStatus = (typeof DataSupplierStatus)[keyof typeof DataSupplierStatus]; +export const DataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataType1 = (typeof DataType1)[keyof typeof DataType1]; +export const DataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataType2 = (typeof DataType2)[keyof typeof DataType2]; +export const DataTypeDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeDataType = (typeof DataTypeDataType)[keyof typeof DataTypeDataType]; +export const DataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypeDataTypes = (typeof DataTypeDataTypes)[keyof typeof DataTypeDataTypes]; +export const DataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type DataTypes = (typeof DataTypes)[keyof typeof DataTypes]; +export const DatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type DatasetStatus = (typeof DatasetStatus)[keyof typeof DatasetStatus]; +export const DefinitionTransactionStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type DefinitionTransactionStatus = (typeof DefinitionTransactionStatus)[keyof typeof DefinitionTransactionStatus]; +export const ErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ErrorStatus = (typeof ErrorStatus)[keyof typeof ErrorStatus]; +export const ExpenseContactRefType = { + Supplier: "Supplier", +} as const; +export type ExpenseContactRefType = (typeof ExpenseContactRefType)[keyof typeof ExpenseContactRefType]; +export const ExpenseTransactionContactRefType = { + Supplier: "Supplier", +} as const; +export type ExpenseTransactionContactRefType = (typeof ExpenseTransactionContactRefType)[keyof typeof ExpenseTransactionContactRefType]; +export const ExpenseTransactionDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ExpenseTransactionDataType = (typeof ExpenseTransactionDataType)[keyof typeof ExpenseTransactionDataType]; +export const ExpenseTransactionInvoiceToType = { + Customer: "customer", +} as const; +export type ExpenseTransactionInvoiceToType = (typeof ExpenseTransactionInvoiceToType)[keyof typeof ExpenseTransactionInvoiceToType]; +export const ExpenseTransactionItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type ExpenseTransactionItems = (typeof ExpenseTransactionItems)[keyof typeof ExpenseTransactionItems]; +export const ExpenseTransactionLineDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ExpenseTransactionLineDataType = (typeof ExpenseTransactionLineDataType)[keyof typeof ExpenseTransactionLineDataType]; +export const ExpenseTransactionLineInvoiceToType = { + Customer: "customer", +} as const; +export type ExpenseTransactionLineInvoiceToType = (typeof ExpenseTransactionLineInvoiceToType)[keyof typeof ExpenseTransactionLineInvoiceToType]; +export const ExpenseTransactionLineTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ExpenseTransactionLineTrackingRefsDataType = (typeof ExpenseTransactionLineTrackingRefsDataType)[keyof typeof ExpenseTransactionLineTrackingRefsDataType]; +export const ExpenseTransactionLineType = { + Customer: "customer", +} as const; +export type ExpenseTransactionLineType = (typeof ExpenseTransactionLineType)[keyof typeof ExpenseTransactionLineType]; +export const ExpenseTransactionTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ExpenseTransactionTrackingRefsDataType = (typeof ExpenseTransactionTrackingRefsDataType)[keyof typeof ExpenseTransactionTrackingRefsDataType]; +export const ExpenseTransactionType = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type ExpenseTransactionType = (typeof ExpenseTransactionType)[keyof typeof ExpenseTransactionType]; +export const ExpenseTransactionType1 = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type ExpenseTransactionType1 = (typeof ExpenseTransactionType1)[keyof typeof ExpenseTransactionType1]; +export const ExpenseTransactionType2 = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type ExpenseTransactionType2 = (typeof ExpenseTransactionType2)[keyof typeof ExpenseTransactionType2]; +export const ExpenseTransactionTypeItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type ExpenseTransactionTypeItems = (typeof ExpenseTransactionTypeItems)[keyof typeof ExpenseTransactionTypeItems]; +export const ExpensesSyncWebhookPayloadStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type ExpensesSyncWebhookPayloadStatus = (typeof ExpensesSyncWebhookPayloadStatus)[keyof typeof ExpensesSyncWebhookPayloadStatus]; +export const ExpensesSyncWebhookPayloadTransactionsStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type ExpensesSyncWebhookPayloadTransactionsStatus = (typeof ExpensesSyncWebhookPayloadTransactionsStatus)[keyof typeof ExpensesSyncWebhookPayloadTransactionsStatus]; +export const ExpensesSyncWebhookStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type ExpensesSyncWebhookStatus = (typeof ExpensesSyncWebhookStatus)[keyof typeof ExpensesSyncWebhookStatus]; +export const ExpensesSyncWebhookTransactionsStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type ExpensesSyncWebhookTransactionsStatus = (typeof ExpensesSyncWebhookTransactionsStatus)[keyof typeof ExpensesSyncWebhookTransactionsStatus]; +export const IntegrationTypeIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type IntegrationTypeIntegrationType = (typeof IntegrationTypeIntegrationType)[keyof typeof IntegrationTypeIntegrationType]; +export const InvoiceToType = { + Customer: "customer", +} as const; +export type InvoiceToType = (typeof InvoiceToType)[keyof typeof InvoiceToType]; +export const Items1 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type Items1 = (typeof Items1)[keyof typeof Items1]; +export const Items2 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type Items2 = (typeof Items2)[keyof typeof Items2]; +export const ItemsAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", +} as const; +export type ItemsAccountType = (typeof ItemsAccountType)[keyof typeof ItemsAccountType]; +export const ItemsAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type ItemsAccountingAddressType = (typeof ItemsAccountingAddressType)[keyof typeof ItemsAccountingAddressType]; +export const ItemsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type ItemsBankAccountStatus = (typeof ItemsBankAccountStatus)[keyof typeof ItemsBankAccountStatus]; +export const ItemsBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type ItemsBankAccountType = (typeof ItemsBankAccountType)[keyof typeof ItemsBankAccountType]; +export const ItemsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ItemsDataConnectionSourceType = (typeof ItemsDataConnectionSourceType)[keyof typeof ItemsDataConnectionSourceType]; +export const ItemsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ItemsDataConnectionStatus = (typeof ItemsDataConnectionStatus)[keyof typeof ItemsDataConnectionStatus]; +export const ItemsDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type ItemsDataType = (typeof ItemsDataType)[keyof typeof ItemsDataType]; +export const ItemsDataType1 = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type ItemsDataType1 = (typeof ItemsDataType1)[keyof typeof ItemsDataType1]; +export const ItemsDataType2 = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type ItemsDataType2 = (typeof ItemsDataType2)[keyof typeof ItemsDataType2]; +export const ItemsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ItemsDataTypes = (typeof ItemsDataTypes)[keyof typeof ItemsDataTypes]; +export const ItemsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ItemsDatasetStatus = (typeof ItemsDatasetStatus)[keyof typeof ItemsDatasetStatus]; +export const ItemsErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ItemsErrorStatus = (typeof ItemsErrorStatus)[keyof typeof ItemsErrorStatus]; +export const ItemsIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type ItemsIntegrationType = (typeof ItemsIntegrationType)[keyof typeof ItemsIntegrationType]; +export const ItemsItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type ItemsItems = (typeof ItemsItems)[keyof typeof ItemsItems]; +export const ItemsItems1 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type ItemsItems1 = (typeof ItemsItems1)[keyof typeof ItemsItems1]; +export const ItemsItems2 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type ItemsItems2 = (typeof ItemsItems2)[keyof typeof ItemsItems2]; +export const ItemsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ItemsPushChangeType = (typeof ItemsPushChangeType)[keyof typeof ItemsPushChangeType]; +export const ItemsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ItemsPushOperationStatus = (typeof ItemsPushOperationStatus)[keyof typeof ItemsPushOperationStatus]; +export const ItemsPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type ItemsPushOptionType = (typeof ItemsPushOptionType)[keyof typeof ItemsPushOptionType]; +export const ItemsStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type ItemsStatus = (typeof ItemsStatus)[keyof typeof ItemsStatus]; +export const ItemsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ItemsSupplierStatus = (typeof ItemsSupplierStatus)[keyof typeof ItemsSupplierStatus]; +export const ItemsTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type ItemsTransactionStatus = (typeof ItemsTransactionStatus)[keyof typeof ItemsTransactionStatus]; +export const ItemsType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type ItemsType = (typeof ItemsType)[keyof typeof ItemsType]; +export const ItemsType1 = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Social: "Social", + Supplier: "Supplier", + Unknown: "Unknown", + Website: "Website", + Customer: "customer", +} as const; +export type ItemsType1 = (typeof ItemsType1)[keyof typeof ItemsType1]; +export const ItemsType2 = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Social: "Social", + Supplier: "Supplier", + Unknown: "Unknown", + Website: "Website", + Customer: "customer", +} as const; +export type ItemsType2 = (typeof ItemsType2)[keyof typeof ItemsType2]; +export const MappingOptionsAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", +} as const; +export type MappingOptionsAccountType = (typeof MappingOptionsAccountType)[keyof typeof MappingOptionsAccountType]; +export const MappingOptionsAccountsAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", +} as const; +export type MappingOptionsAccountsAccountType = (typeof MappingOptionsAccountsAccountType)[keyof typeof MappingOptionsAccountsAccountType]; +export const MappingOptionsItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type MappingOptionsItems = (typeof MappingOptionsItems)[keyof typeof MappingOptionsItems]; +export const MappingOptionsItems1 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type MappingOptionsItems1 = (typeof MappingOptionsItems1)[keyof typeof MappingOptionsItems1]; +export const MappingOptionsItems2 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type MappingOptionsItems2 = (typeof MappingOptionsItems2)[keyof typeof MappingOptionsItems2]; +export const MappingOptionsValidForItems = { + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type MappingOptionsValidForItems = (typeof MappingOptionsValidForItems)[keyof typeof MappingOptionsValidForItems]; +export const MappingOptionsValidTransactionTypesItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type MappingOptionsValidTransactionTypesItems = (typeof MappingOptionsValidTransactionTypesItems)[keyof typeof MappingOptionsValidTransactionTypesItems]; +export const OneAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type OneAccountType = (typeof OneAccountType)[keyof typeof OneAccountType]; +export const OneBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type OneBankAccountStatus = (typeof OneBankAccountStatus)[keyof typeof OneBankAccountStatus]; +export const OneBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type OneBankAccountType = (typeof OneBankAccountType)[keyof typeof OneBankAccountType]; +export const OneDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type OneDataConnectionSourceType = (typeof OneDataConnectionSourceType)[keyof typeof OneDataConnectionSourceType]; +export const OneDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type OneDataConnectionStatus = (typeof OneDataConnectionStatus)[keyof typeof OneDataConnectionStatus]; +export const OneDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type OneDataTypes = (typeof OneDataTypes)[keyof typeof OneDataTypes]; +export const OneErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type OneErrorStatus = (typeof OneErrorStatus)[keyof typeof OneErrorStatus]; +export const OnePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type OnePushChangeType = (typeof OnePushChangeType)[keyof typeof OnePushChangeType]; +export const OnePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type OnePushOperationStatus = (typeof OnePushOperationStatus)[keyof typeof OnePushOperationStatus]; +export const OptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type OptionType = (typeof OptionType)[keyof typeof OptionType]; +export const OptionTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type OptionTypePushOptionType = (typeof OptionTypePushOptionType)[keyof typeof OptionTypePushOptionType]; +export const PhoneNumberItemsType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type PhoneNumberItemsType = (typeof PhoneNumberItemsType)[keyof typeof PhoneNumberItemsType]; +export const PhoneNumbersType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type PhoneNumbersType = (typeof PhoneNumbersType)[keyof typeof PhoneNumbersType]; +export const PhoneType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type PhoneType = (typeof PhoneType)[keyof typeof PhoneType]; +export const PropertieAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type PropertieAccountStatus = (typeof PropertieAccountStatus)[keyof typeof PropertieAccountStatus]; +export const PropertieAccountType = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type PropertieAccountType = (typeof PropertieAccountType)[keyof typeof PropertieAccountType]; +export const PropertieAccountType1 = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type PropertieAccountType1 = (typeof PropertieAccountType1)[keyof typeof PropertieAccountType1]; +export const PropertieAccountType2 = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type PropertieAccountType2 = (typeof PropertieAccountType2)[keyof typeof PropertieAccountType2]; +export const PropertieBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type PropertieBankAccountStatus = (typeof PropertieBankAccountStatus)[keyof typeof PropertieBankAccountStatus]; +export const PropertieBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type PropertieBankAccountType = (typeof PropertieBankAccountType)[keyof typeof PropertieBankAccountType]; +export const PropertieCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieCurrentStatus = (typeof PropertieCurrentStatus)[keyof typeof PropertieCurrentStatus]; +export const PropertieDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieDataConnectionSourceType = (typeof PropertieDataConnectionSourceType)[keyof typeof PropertieDataConnectionSourceType]; +export const PropertieDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type PropertieDataConnectionStatus = (typeof PropertieDataConnectionStatus)[keyof typeof PropertieDataConnectionStatus]; +export const PropertieDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType = (typeof PropertieDataType)[keyof typeof PropertieDataType]; +export const PropertieDataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType1 = (typeof PropertieDataType1)[keyof typeof PropertieDataType1]; +export const PropertieDataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataType2 = (typeof PropertieDataType2)[keyof typeof PropertieDataType2]; +export const PropertieDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PropertieDataTypes = (typeof PropertieDataTypes)[keyof typeof PropertieDataTypes]; +export const PropertieDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieDatasetStatus = (typeof PropertieDatasetStatus)[keyof typeof PropertieDatasetStatus]; +export const PropertieErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type PropertieErrorStatus = (typeof PropertieErrorStatus)[keyof typeof PropertieErrorStatus]; +export const PropertieIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type PropertieIntegrationType = (typeof PropertieIntegrationType)[keyof typeof PropertieIntegrationType]; +export const PropertieItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type PropertieItems = (typeof PropertieItems)[keyof typeof PropertieItems]; +export const PropertieItems1 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type PropertieItems1 = (typeof PropertieItems1)[keyof typeof PropertieItems1]; +export const PropertieItems2 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type PropertieItems2 = (typeof PropertieItems2)[keyof typeof PropertieItems2]; +export const PropertieOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PropertieOptionType = (typeof PropertieOptionType)[keyof typeof PropertieOptionType]; +export const PropertiePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PropertiePushChangeType = (typeof PropertiePushChangeType)[keyof typeof PropertiePushChangeType]; +export const PropertiePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PropertiePushOperationStatus = (typeof PropertiePushOperationStatus)[keyof typeof PropertiePushOperationStatus]; +export const PropertiePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PropertiePushOptionType = (typeof PropertiePushOptionType)[keyof typeof PropertiePushOptionType]; +export const PropertieSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type PropertieSourceType = (typeof PropertieSourceType)[keyof typeof PropertieSourceType]; +export const PropertieStatus = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus = (typeof PropertieStatus)[keyof typeof PropertieStatus]; +export const PropertieStatus1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus1 = (typeof PropertieStatus1)[keyof typeof PropertieStatus1]; +export const PropertieStatus2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PropertieStatus2 = (typeof PropertieStatus2)[keyof typeof PropertieStatus2]; +export const PropertieTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type PropertieTransactionStatus = (typeof PropertieTransactionStatus)[keyof typeof PropertieTransactionStatus]; +export const PropertieType = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Supplier: "Supplier", + Unknown: "Unknown", + Customer: "customer", +} as const; +export type PropertieType = (typeof PropertieType)[keyof typeof PropertieType]; +export const PropertieType1 = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Supplier: "Supplier", + Unknown: "Unknown", + Customer: "customer", +} as const; +export type PropertieType1 = (typeof PropertieType1)[keyof typeof PropertieType1]; +export const PropertieType2 = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Supplier: "Supplier", + Unknown: "Unknown", + Customer: "customer", +} as const; +export type PropertieType2 = (typeof PropertieType2)[keyof typeof PropertieType2]; +export const PullOperationDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationDatasetStatus = (typeof PullOperationDatasetStatus)[keyof typeof PullOperationDatasetStatus]; +export const PullOperationStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatus = (typeof PullOperationStatus)[keyof typeof PullOperationStatus]; +export const PullOperationStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationStatusDatasetStatus = (typeof PullOperationStatusDatasetStatus)[keyof typeof PullOperationStatusDatasetStatus]; +export const PullOperationsDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsDatasetStatus = (typeof PullOperationsDatasetStatus)[keyof typeof PullOperationsDatasetStatus]; +export const PullOperationsStatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type PullOperationsStatusDatasetStatus = (typeof PullOperationsStatusDatasetStatus)[keyof typeof PullOperationsStatusDatasetStatus]; +export const PushChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushChangeTypePushChangeType = (typeof PushChangeTypePushChangeType)[keyof typeof PushChangeTypePushChangeType]; +export const PushOperationChangeDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataTypeDataTypes = (typeof PushOperationChangeDataTypeDataTypes)[keyof typeof PushOperationChangeDataTypeDataTypes]; +export const PushOperationChangeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationChangeDataTypes = (typeof PushOperationChangeDataTypes)[keyof typeof PushOperationChangeDataTypes]; +export const PushOperationChangePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangePushChangeType = (typeof PushOperationChangePushChangeType)[keyof typeof PushOperationChangePushChangeType]; +export const PushOperationChangeTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationChangeTypePushChangeType = (typeof PushOperationChangeTypePushChangeType)[keyof typeof PushOperationChangeTypePushChangeType]; +export const PushOperationDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataType = (typeof PushOperationDataType)[keyof typeof PushOperationDataType]; +export const PushOperationDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataTypeDataTypes = (typeof PushOperationDataTypeDataTypes)[keyof typeof PushOperationDataTypeDataTypes]; +export const PushOperationDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationDataTypes = (typeof PushOperationDataTypes)[keyof typeof PushOperationDataTypes]; +export const PushOperationPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationPushChangeType = (typeof PushOperationPushChangeType)[keyof typeof PushOperationPushChangeType]; +export const PushOperationPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationPushOperationStatus = (typeof PushOperationPushOperationStatus)[keyof typeof PushOperationPushOperationStatus]; +export const PushOperationRefDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataType = (typeof PushOperationRefDataType)[keyof typeof PushOperationRefDataType]; +export const PushOperationRefDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataTypeDataTypes = (typeof PushOperationRefDataTypeDataTypes)[keyof typeof PushOperationRefDataTypeDataTypes]; +export const PushOperationRefDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationRefDataTypes = (typeof PushOperationRefDataTypes)[keyof typeof PushOperationRefDataTypes]; +export const PushOperationReferenceDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataTypeDataTypes = (typeof PushOperationReferenceDataTypeDataTypes)[keyof typeof PushOperationReferenceDataTypeDataTypes]; +export const PushOperationReferenceDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationReferenceDataTypes = (typeof PushOperationReferenceDataTypes)[keyof typeof PushOperationReferenceDataTypes]; +export const PushOperationStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationStatusPushOperationStatus = (typeof PushOperationStatusPushOperationStatus)[keyof typeof PushOperationStatusPushOperationStatus]; +export const PushOperationTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationTypePushChangeType = (typeof PushOperationTypePushChangeType)[keyof typeof PushOperationTypePushChangeType]; +export const PushOperationsDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataTypeDataTypes = (typeof PushOperationsDataTypeDataTypes)[keyof typeof PushOperationsDataTypeDataTypes]; +export const PushOperationsDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type PushOperationsDataTypes = (typeof PushOperationsDataTypes)[keyof typeof PushOperationsDataTypes]; +export const PushOperationsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsPushChangeType = (typeof PushOperationsPushChangeType)[keyof typeof PushOperationsPushChangeType]; +export const PushOperationsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsPushOperationStatus = (typeof PushOperationsPushOperationStatus)[keyof typeof PushOperationsPushOperationStatus]; +export const PushOperationsResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsResultsPushChangeType = (typeof PushOperationsResultsPushChangeType)[keyof typeof PushOperationsResultsPushChangeType]; +export const PushOperationsResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsResultsPushOperationStatus = (typeof PushOperationsResultsPushOperationStatus)[keyof typeof PushOperationsResultsPushOperationStatus]; +export const PushOperationsStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type PushOperationsStatusPushOperationStatus = (typeof PushOperationsStatusPushOperationStatus)[keyof typeof PushOperationsStatusPushOperationStatus]; +export const PushOperationsTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type PushOperationsTypePushChangeType = (typeof PushOperationsTypePushChangeType)[keyof typeof PushOperationsTypePushChangeType]; +export const PushOptionChoicePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionChoicePushOptionType = (typeof PushOptionChoicePushOptionType)[keyof typeof PushOptionChoicePushOptionType]; +export const PushOptionChoiceTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionChoiceTypePushOptionType = (typeof PushOptionChoiceTypePushOptionType)[keyof typeof PushOptionChoiceTypePushOptionType]; +export const PushOptionPropertyPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPropertyPushOptionType = (typeof PushOptionPropertyPushOptionType)[keyof typeof PushOptionPropertyPushOptionType]; +export const PushOptionPropertyTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPropertyTypePushOptionType = (typeof PushOptionPropertyTypePushOptionType)[keyof typeof PushOptionPropertyTypePushOptionType]; +export const PushOptionPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionPushOptionType = (typeof PushOptionPushOptionType)[keyof typeof PushOptionPushOptionType]; +export const PushOptionTypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type PushOptionTypePushOptionType = (typeof PushOptionTypePushOptionType)[keyof typeof PushOptionTypePushOptionType]; +export const ReimbursableExpenseTransactionDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ReimbursableExpenseTransactionDataType = (typeof ReimbursableExpenseTransactionDataType)[keyof typeof ReimbursableExpenseTransactionDataType]; +export const ReimbursableExpenseTransactionInvoiceToType = { + Customer: "customer", +} as const; +export type ReimbursableExpenseTransactionInvoiceToType = (typeof ReimbursableExpenseTransactionInvoiceToType)[keyof typeof ReimbursableExpenseTransactionInvoiceToType]; +export const ReimbursableExpenseTransactionLineDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ReimbursableExpenseTransactionLineDataType = (typeof ReimbursableExpenseTransactionLineDataType)[keyof typeof ReimbursableExpenseTransactionLineDataType]; +export const ReimbursableExpenseTransactionLineInvoiceToType = { + Customer: "customer", +} as const; +export type ReimbursableExpenseTransactionLineInvoiceToType = (typeof ReimbursableExpenseTransactionLineInvoiceToType)[keyof typeof ReimbursableExpenseTransactionLineInvoiceToType]; +export const ReimbursableExpenseTransactionLineTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ReimbursableExpenseTransactionLineTrackingRefsDataType = (typeof ReimbursableExpenseTransactionLineTrackingRefsDataType)[keyof typeof ReimbursableExpenseTransactionLineTrackingRefsDataType]; +export const ReimbursableExpenseTransactionLineType = { + Customer: "customer", +} as const; +export type ReimbursableExpenseTransactionLineType = (typeof ReimbursableExpenseTransactionLineType)[keyof typeof ReimbursableExpenseTransactionLineType]; +export const ReimbursableExpenseTransactionRequestDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ReimbursableExpenseTransactionRequestDataType = (typeof ReimbursableExpenseTransactionRequestDataType)[keyof typeof ReimbursableExpenseTransactionRequestDataType]; +export const ReimbursableExpenseTransactionRequestInvoiceToType = { + Customer: "customer", +} as const; +export type ReimbursableExpenseTransactionRequestInvoiceToType = (typeof ReimbursableExpenseTransactionRequestInvoiceToType)[keyof typeof ReimbursableExpenseTransactionRequestInvoiceToType]; +export const ReimbursableExpenseTransactionRequestTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ReimbursableExpenseTransactionRequestTrackingRefsDataType = (typeof ReimbursableExpenseTransactionRequestTrackingRefsDataType)[keyof typeof ReimbursableExpenseTransactionRequestTrackingRefsDataType]; +export const ReimbursableExpenseTransactionRequestType = { + Customer: "customer", +} as const; +export type ReimbursableExpenseTransactionRequestType = (typeof ReimbursableExpenseTransactionRequestType)[keyof typeof ReimbursableExpenseTransactionRequestType]; +export const ReimbursableExpenseTransactionTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type ReimbursableExpenseTransactionTrackingRefsDataType = (typeof ReimbursableExpenseTransactionTrackingRefsDataType)[keyof typeof ReimbursableExpenseTransactionTrackingRefsDataType]; +export const ReimbursableExpenseTransactionType = { + Customer: "customer", +} as const; +export type ReimbursableExpenseTransactionType = (typeof ReimbursableExpenseTransactionType)[keyof typeof ReimbursableExpenseTransactionType]; +export const ResultsBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type ResultsBankAccountStatus = (typeof ResultsBankAccountStatus)[keyof typeof ResultsBankAccountStatus]; +export const ResultsDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ResultsDataConnectionSourceType = (typeof ResultsDataConnectionSourceType)[keyof typeof ResultsDataConnectionSourceType]; +export const ResultsDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ResultsDataConnectionStatus = (typeof ResultsDataConnectionStatus)[keyof typeof ResultsDataConnectionStatus]; +export const ResultsIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type ResultsIntegrationType = (typeof ResultsIntegrationType)[keyof typeof ResultsIntegrationType]; +export const ResultsPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ResultsPushChangeType = (typeof ResultsPushChangeType)[keyof typeof ResultsPushChangeType]; +export const ResultsPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ResultsPushOperationStatus = (typeof ResultsPushOperationStatus)[keyof typeof ResultsPushOperationStatus]; +export const ResultsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ResultsSupplierStatus = (typeof ResultsSupplierStatus)[keyof typeof ResultsSupplierStatus]; +export const SchemaAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type SchemaAccountStatus = (typeof SchemaAccountStatus)[keyof typeof SchemaAccountStatus]; +export const SchemaAccountType = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type SchemaAccountType = (typeof SchemaAccountType)[keyof typeof SchemaAccountType]; +export const SchemaAccountType1 = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type SchemaAccountType1 = (typeof SchemaAccountType1)[keyof typeof SchemaAccountType1]; +export const SchemaAccountType2 = { + Asset: "Asset", + Credit: "Credit", + Debit: "Debit", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type SchemaAccountType2 = (typeof SchemaAccountType2)[keyof typeof SchemaAccountType2]; +export const SchemaBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type SchemaBankAccountStatus = (typeof SchemaBankAccountStatus)[keyof typeof SchemaBankAccountStatus]; +export const SchemaBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type SchemaBankAccountType = (typeof SchemaBankAccountType)[keyof typeof SchemaBankAccountType]; +export const SchemaCurrentStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaCurrentStatus = (typeof SchemaCurrentStatus)[keyof typeof SchemaCurrentStatus]; +export const SchemaDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaDataConnectionSourceType = (typeof SchemaDataConnectionSourceType)[keyof typeof SchemaDataConnectionSourceType]; +export const SchemaDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type SchemaDataConnectionStatus = (typeof SchemaDataConnectionStatus)[keyof typeof SchemaDataConnectionStatus]; +export const SchemaDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType = (typeof SchemaDataType)[keyof typeof SchemaDataType]; +export const SchemaDataType1 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType1 = (typeof SchemaDataType1)[keyof typeof SchemaDataType1]; +export const SchemaDataType2 = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataType2 = (typeof SchemaDataType2)[keyof typeof SchemaDataType2]; +export const SchemaDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type SchemaDataTypes = (typeof SchemaDataTypes)[keyof typeof SchemaDataTypes]; +export const SchemaDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaDatasetStatus = (typeof SchemaDatasetStatus)[keyof typeof SchemaDatasetStatus]; +export const SchemaErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type SchemaErrorStatus = (typeof SchemaErrorStatus)[keyof typeof SchemaErrorStatus]; +export const SchemaIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type SchemaIntegrationType = (typeof SchemaIntegrationType)[keyof typeof SchemaIntegrationType]; +export const SchemaItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type SchemaItems = (typeof SchemaItems)[keyof typeof SchemaItems]; +export const SchemaItems1 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type SchemaItems1 = (typeof SchemaItems1)[keyof typeof SchemaItems1]; +export const SchemaItems2 = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type SchemaItems2 = (typeof SchemaItems2)[keyof typeof SchemaItems2]; +export const SchemaOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type SchemaOptionType = (typeof SchemaOptionType)[keyof typeof SchemaOptionType]; +export const SchemaPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type SchemaPushChangeType = (typeof SchemaPushChangeType)[keyof typeof SchemaPushChangeType]; +export const SchemaPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type SchemaPushOperationStatus = (typeof SchemaPushOperationStatus)[keyof typeof SchemaPushOperationStatus]; +export const SchemaPushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type SchemaPushOptionType = (typeof SchemaPushOptionType)[keyof typeof SchemaPushOptionType]; +export const SchemaSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SchemaSourceType = (typeof SchemaSourceType)[keyof typeof SchemaSourceType]; +export const SchemaStatus = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus = (typeof SchemaStatus)[keyof typeof SchemaStatus]; +export const SchemaStatus1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus1 = (typeof SchemaStatus1)[keyof typeof SchemaStatus1]; +export const SchemaStatus2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type SchemaStatus2 = (typeof SchemaStatus2)[keyof typeof SchemaStatus2]; +export const SchemaTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type SchemaTransactionStatus = (typeof SchemaTransactionStatus)[keyof typeof SchemaTransactionStatus]; +export const SchemaType = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Supplier: "Supplier", + Unknown: "Unknown", + Customer: "customer", +} as const; +export type SchemaType = (typeof SchemaType)[keyof typeof SchemaType]; +export const SchemaType1 = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Supplier: "Supplier", + Unknown: "Unknown", + Customer: "customer", +} as const; +export type SchemaType1 = (typeof SchemaType1)[keyof typeof SchemaType1]; +export const SchemaType2 = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Supplier: "Supplier", + Unknown: "Unknown", + Customer: "customer", +} as const; +export type SchemaType2 = (typeof SchemaType2)[keyof typeof SchemaType2]; +export const SourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceType = (typeof SourceType)[keyof typeof SourceType]; +export const SourceTypeDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type SourceTypeDataConnectionSourceType = (typeof SourceTypeDataConnectionSourceType)[keyof typeof SourceTypeDataConnectionSourceType]; +export const Status1 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type Status1 = (typeof Status1)[keyof typeof Status1]; +export const Status2 = { + Active: "Active", + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + Completed: "Completed", + Failed: "Failed", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + Pending: "Pending", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + PushError: "PushError", + Queued: "Queued", + RateLimitError: "RateLimitError", + Resolved: "Resolved", + Unknown: "Unknown", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type Status2 = (typeof Status2)[keyof typeof Status2]; +export const StatusBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type StatusBankAccountStatus = (typeof StatusBankAccountStatus)[keyof typeof StatusBankAccountStatus]; +export const StatusDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type StatusDataConnectionStatus = (typeof StatusDataConnectionStatus)[keyof typeof StatusDataConnectionStatus]; +export const StatusDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusDatasetStatus = (typeof StatusDatasetStatus)[keyof typeof StatusDatasetStatus]; +export const StatusErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type StatusErrorStatus = (typeof StatusErrorStatus)[keyof typeof StatusErrorStatus]; +export const StatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type StatusPushOperationStatus = (typeof StatusPushOperationStatus)[keyof typeof StatusPushOperationStatus]; +export const StatusStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type StatusStatus = (typeof StatusStatus)[keyof typeof StatusStatus]; +export const StatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type StatusSupplierStatus = (typeof StatusSupplierStatus)[keyof typeof StatusSupplierStatus]; +export const StatusTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type StatusTransactionStatus = (typeof StatusTransactionStatus)[keyof typeof StatusTransactionStatus]; +export const SupplierAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierAccountingAddressType = (typeof SupplierAccountingAddressType)[keyof typeof SupplierAccountingAddressType]; +export const SupplierAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierAddressesAccountingAddressType = (typeof SupplierAddressesAccountingAddressType)[keyof typeof SupplierAddressesAccountingAddressType]; +export const SupplierStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierStatusSupplierStatus = (typeof SupplierStatusSupplierStatus)[keyof typeof SupplierStatusSupplierStatus]; +export const SupplierSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SupplierSupplierStatus = (typeof SupplierSupplierStatus)[keyof typeof SupplierSupplierStatus]; +export const SupplierTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SupplierTypeAccountingAddressType = (typeof SupplierTypeAccountingAddressType)[keyof typeof SupplierTypeAccountingAddressType]; +export const SuppliersAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SuppliersAccountingAddressType = (typeof SuppliersAccountingAddressType)[keyof typeof SuppliersAccountingAddressType]; +export const SuppliersAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SuppliersAddressesAccountingAddressType = (typeof SuppliersAddressesAccountingAddressType)[keyof typeof SuppliersAddressesAccountingAddressType]; +export const SuppliersResultsSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SuppliersResultsSupplierStatus = (typeof SuppliersResultsSupplierStatus)[keyof typeof SuppliersResultsSupplierStatus]; +export const SuppliersStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SuppliersStatusSupplierStatus = (typeof SuppliersStatusSupplierStatus)[keyof typeof SuppliersStatusSupplierStatus]; +export const SuppliersSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type SuppliersSupplierStatus = (typeof SuppliersSupplierStatus)[keyof typeof SuppliersSupplierStatus]; +export const SuppliersTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type SuppliersTypeAccountingAddressType = (typeof SuppliersTypeAccountingAddressType)[keyof typeof SuppliersTypeAccountingAddressType]; +export const TaxRateMappingInfoItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type TaxRateMappingInfoItems = (typeof TaxRateMappingInfoItems)[keyof typeof TaxRateMappingInfoItems]; +export const TaxRateMappingInfoValidTransactionTypes = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type TaxRateMappingInfoValidTransactionTypes = (typeof TaxRateMappingInfoValidTransactionTypes)[keyof typeof TaxRateMappingInfoValidTransactionTypes]; +export const TaxRateMappingInfoValidTransactionTypesItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type TaxRateMappingInfoValidTransactionTypesItems = (typeof TaxRateMappingInfoValidTransactionTypesItems)[keyof typeof TaxRateMappingInfoValidTransactionTypesItems]; +export const TrackingRefAdjustmentTransactionDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefAdjustmentTransactionDataType = (typeof TrackingRefAdjustmentTransactionDataType)[keyof typeof TrackingRefAdjustmentTransactionDataType]; +export const TrackingRefDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefDataType = (typeof TrackingRefDataType)[keyof typeof TrackingRefDataType]; +export const TrackingRefsDataType = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefsDataType = (typeof TrackingRefsDataType)[keyof typeof TrackingRefsDataType]; +export const TrackingRefsDataType1 = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefsDataType1 = (typeof TrackingRefsDataType1)[keyof typeof TrackingRefsDataType1]; +export const TrackingRefsDataType2 = { + Customers: "customers", + Suppliers: "suppliers", + TrackingCategories: "trackingCategories", +} as const; +export type TrackingRefsDataType2 = (typeof TrackingRefsDataType2)[keyof typeof TrackingRefsDataType2]; +export const TransactionIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type TransactionIntegrationType = (typeof TransactionIntegrationType)[keyof typeof TransactionIntegrationType]; +export const TransactionResponseIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type TransactionResponseIntegrationType = (typeof TransactionResponseIntegrationType)[keyof typeof TransactionResponseIntegrationType]; +export const TransactionResponseStatusTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionResponseStatusTransactionStatus = (typeof TransactionResponseStatusTransactionStatus)[keyof typeof TransactionResponseStatusTransactionStatus]; +export const TransactionResponseTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionResponseTransactionStatus = (typeof TransactionResponseTransactionStatus)[keyof typeof TransactionResponseTransactionStatus]; +export const TransactionStatus1 = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type TransactionStatus1 = (typeof TransactionStatus1)[keyof typeof TransactionStatus1]; +export const TransactionStatus2 = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionStatus2 = (typeof TransactionStatus2)[keyof typeof TransactionStatus2]; +export const TransactionStatusTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionStatusTransactionStatus = (typeof TransactionStatusTransactionStatus)[keyof typeof TransactionStatusTransactionStatus]; +export const TransactionTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionTransactionStatus = (typeof TransactionTransactionStatus)[keyof typeof TransactionTransactionStatus]; +export const TransactionsIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type TransactionsIntegrationType = (typeof TransactionsIntegrationType)[keyof typeof TransactionsIntegrationType]; +export const TransactionsResultsIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type TransactionsResultsIntegrationType = (typeof TransactionsResultsIntegrationType)[keyof typeof TransactionsResultsIntegrationType]; +export const TransactionsStatus = { + Completed: "Completed", + Failed: "Failed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", +} as const; +export type TransactionsStatus = (typeof TransactionsStatus)[keyof typeof TransactionsStatus]; +export const TransactionsStatusTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionsStatusTransactionStatus = (typeof TransactionsStatusTransactionStatus)[keyof typeof TransactionsStatusTransactionStatus]; +export const TransactionsTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type TransactionsTransactionStatus = (typeof TransactionsTransactionStatus)[keyof typeof TransactionsTransactionStatus]; +export const Type = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type Type = (typeof Type)[keyof typeof Type]; +export const Type1 = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Social: "Social", + Supplier: "Supplier", + Unknown: "Unknown", + Website: "Website", + Customer: "customer", +} as const; +export type Type1 = (typeof Type1)[keyof typeof Type1]; +export const Type2 = { + Chargeback: "Chargeback", + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Payment: "Payment", + Primary: "Primary", + Refund: "Refund", + Reward: "Reward", + Social: "Social", + Supplier: "Supplier", + Unknown: "Unknown", + Website: "Website", + Customer: "customer", +} as const; +export type Type2 = (typeof Type2)[keyof typeof Type2]; +export const TypeAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type TypeAccountType = (typeof TypeAccountType)[keyof typeof TypeAccountType]; +export const TypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type TypeAccountingAddressType = (typeof TypeAccountingAddressType)[keyof typeof TypeAccountingAddressType]; +export const TypeItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type TypeItems = (typeof TypeItems)[keyof typeof TypeItems]; +export const TypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type TypePushChangeType = (typeof TypePushChangeType)[keyof typeof TypePushChangeType]; +export const TypePushOptionType = { + Array: "Array", + Boolean: "Boolean", + DateTime: "DateTime", + File: "File", + MultiPart: "MultiPart", + Number: "Number", + Object: "Object", + String: "String", +} as const; +export type TypePushOptionType = (typeof TypePushOptionType)[keyof typeof TypePushOptionType]; +export const UpdateCustomerResponseAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseAccountingAddressType = (typeof UpdateCustomerResponseAccountingAddressType)[keyof typeof UpdateCustomerResponseAccountingAddressType]; +export const UpdateCustomerResponseAddressAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseAddressAccountingAddressType = (typeof UpdateCustomerResponseAddressAccountingAddressType)[keyof typeof UpdateCustomerResponseAddressAccountingAddressType]; +export const UpdateCustomerResponseAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseAddressesAccountingAddressType = (typeof UpdateCustomerResponseAddressesAccountingAddressType)[keyof typeof UpdateCustomerResponseAddressesAccountingAddressType]; +export const UpdateCustomerResponseDataSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseDataSupplierStatus = (typeof UpdateCustomerResponseDataSupplierStatus)[keyof typeof UpdateCustomerResponseDataSupplierStatus]; +export const UpdateCustomerResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateCustomerResponseDataType = (typeof UpdateCustomerResponseDataType)[keyof typeof UpdateCustomerResponseDataType]; +export const UpdateCustomerResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateCustomerResponseDataTypeDataTypes = (typeof UpdateCustomerResponseDataTypeDataTypes)[keyof typeof UpdateCustomerResponseDataTypeDataTypes]; +export const UpdateCustomerResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateCustomerResponseDataTypes = (typeof UpdateCustomerResponseDataTypes)[keyof typeof UpdateCustomerResponseDataTypes]; +export const UpdateCustomerResponsePhoneType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponsePhoneType = (typeof UpdateCustomerResponsePhoneType)[keyof typeof UpdateCustomerResponsePhoneType]; +export const UpdateCustomerResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponsePushChangeType = (typeof UpdateCustomerResponsePushChangeType)[keyof typeof UpdateCustomerResponsePushChangeType]; +export const UpdateCustomerResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type UpdateCustomerResponsePushOperationStatus = (typeof UpdateCustomerResponsePushOperationStatus)[keyof typeof UpdateCustomerResponsePushOperationStatus]; +export const UpdateCustomerResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type UpdateCustomerResponseStatusPushOperationStatus = (typeof UpdateCustomerResponseStatusPushOperationStatus)[keyof typeof UpdateCustomerResponseStatusPushOperationStatus]; +export const UpdateCustomerResponseStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseStatusSupplierStatus = (typeof UpdateCustomerResponseStatusSupplierStatus)[keyof typeof UpdateCustomerResponseStatusSupplierStatus]; +export const UpdateCustomerResponseSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseSupplierStatus = (typeof UpdateCustomerResponseSupplierStatus)[keyof typeof UpdateCustomerResponseSupplierStatus]; +export const UpdateCustomerResponseType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseType = (typeof UpdateCustomerResponseType)[keyof typeof UpdateCustomerResponseType]; +export const UpdateCustomerResponseTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseTypeAccountingAddressType = (typeof UpdateCustomerResponseTypeAccountingAddressType)[keyof typeof UpdateCustomerResponseTypeAccountingAddressType]; +export const UpdateCustomerResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type UpdateCustomerResponseTypePushChangeType = (typeof UpdateCustomerResponseTypePushChangeType)[keyof typeof UpdateCustomerResponseTypePushChangeType]; +export const UpdateExpenseRequestContactRefType = { + Supplier: "Supplier", +} as const; +export type UpdateExpenseRequestContactRefType = (typeof UpdateExpenseRequestContactRefType)[keyof typeof UpdateExpenseRequestContactRefType]; +export const UpdateExpenseRequestDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type UpdateExpenseRequestDataType = (typeof UpdateExpenseRequestDataType)[keyof typeof UpdateExpenseRequestDataType]; +export const UpdateExpenseRequestInvoiceToType = { + Customer: "customer", +} as const; +export type UpdateExpenseRequestInvoiceToType = (typeof UpdateExpenseRequestInvoiceToType)[keyof typeof UpdateExpenseRequestInvoiceToType]; +export const UpdateExpenseRequestItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type UpdateExpenseRequestItems = (typeof UpdateExpenseRequestItems)[keyof typeof UpdateExpenseRequestItems]; +export const UpdateExpenseRequestTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type UpdateExpenseRequestTrackingRefsDataType = (typeof UpdateExpenseRequestTrackingRefsDataType)[keyof typeof UpdateExpenseRequestTrackingRefsDataType]; +export const UpdateExpenseRequestType = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type UpdateExpenseRequestType = (typeof UpdateExpenseRequestType)[keyof typeof UpdateExpenseRequestType]; +export const UpdateExpenseRequestType1 = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type UpdateExpenseRequestType1 = (typeof UpdateExpenseRequestType1)[keyof typeof UpdateExpenseRequestType1]; +export const UpdateExpenseRequestType2 = { + Supplier: "Supplier", + Customer: "customer", +} as const; +export type UpdateExpenseRequestType2 = (typeof UpdateExpenseRequestType2)[keyof typeof UpdateExpenseRequestType2]; +export const UpdateExpenseRequestTypeItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type UpdateExpenseRequestTypeItems = (typeof UpdateExpenseRequestTypeItems)[keyof typeof UpdateExpenseRequestTypeItems]; +export const UpdateReimbursableExpenseTransactionRequestDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type UpdateReimbursableExpenseTransactionRequestDataType = (typeof UpdateReimbursableExpenseTransactionRequestDataType)[keyof typeof UpdateReimbursableExpenseTransactionRequestDataType]; +export const UpdateReimbursableExpenseTransactionRequestInvoiceToType = { + Customer: "customer", +} as const; +export type UpdateReimbursableExpenseTransactionRequestInvoiceToType = (typeof UpdateReimbursableExpenseTransactionRequestInvoiceToType)[keyof typeof UpdateReimbursableExpenseTransactionRequestInvoiceToType]; +export const UpdateReimbursableExpenseTransactionRequestTrackingRefsDataType = { + Customers: "customers", + TrackingCategories: "trackingCategories", +} as const; +export type UpdateReimbursableExpenseTransactionRequestTrackingRefsDataType = (typeof UpdateReimbursableExpenseTransactionRequestTrackingRefsDataType)[keyof typeof UpdateReimbursableExpenseTransactionRequestTrackingRefsDataType]; +export const UpdateReimbursableExpenseTransactionRequestType = { + Customer: "customer", +} as const; +export type UpdateReimbursableExpenseTransactionRequestType = (typeof UpdateReimbursableExpenseTransactionRequestType)[keyof typeof UpdateReimbursableExpenseTransactionRequestType]; +export const UpdateSupplierResponseAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseAccountingAddressType = (typeof UpdateSupplierResponseAccountingAddressType)[keyof typeof UpdateSupplierResponseAccountingAddressType]; +export const UpdateSupplierResponseAddressesAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseAddressesAccountingAddressType = (typeof UpdateSupplierResponseAddressesAccountingAddressType)[keyof typeof UpdateSupplierResponseAddressesAccountingAddressType]; +export const UpdateSupplierResponseDataSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseDataSupplierStatus = (typeof UpdateSupplierResponseDataSupplierStatus)[keyof typeof UpdateSupplierResponseDataSupplierStatus]; +export const UpdateSupplierResponseDataType = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateSupplierResponseDataType = (typeof UpdateSupplierResponseDataType)[keyof typeof UpdateSupplierResponseDataType]; +export const UpdateSupplierResponseDataTypeDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateSupplierResponseDataTypeDataTypes = (typeof UpdateSupplierResponseDataTypeDataTypes)[keyof typeof UpdateSupplierResponseDataTypeDataTypes]; +export const UpdateSupplierResponseDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type UpdateSupplierResponseDataTypes = (typeof UpdateSupplierResponseDataTypes)[keyof typeof UpdateSupplierResponseDataTypes]; +export const UpdateSupplierResponsePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponsePushChangeType = (typeof UpdateSupplierResponsePushChangeType)[keyof typeof UpdateSupplierResponsePushChangeType]; +export const UpdateSupplierResponsePushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type UpdateSupplierResponsePushOperationStatus = (typeof UpdateSupplierResponsePushOperationStatus)[keyof typeof UpdateSupplierResponsePushOperationStatus]; +export const UpdateSupplierResponseStatusPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type UpdateSupplierResponseStatusPushOperationStatus = (typeof UpdateSupplierResponseStatusPushOperationStatus)[keyof typeof UpdateSupplierResponseStatusPushOperationStatus]; +export const UpdateSupplierResponseStatusSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseStatusSupplierStatus = (typeof UpdateSupplierResponseStatusSupplierStatus)[keyof typeof UpdateSupplierResponseStatusSupplierStatus]; +export const UpdateSupplierResponseSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseSupplierStatus = (typeof UpdateSupplierResponseSupplierStatus)[keyof typeof UpdateSupplierResponseSupplierStatus]; +export const UpdateSupplierResponseTypeAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseTypeAccountingAddressType = (typeof UpdateSupplierResponseTypeAccountingAddressType)[keyof typeof UpdateSupplierResponseTypeAccountingAddressType]; +export const UpdateSupplierResponseTypePushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type UpdateSupplierResponseTypePushChangeType = (typeof UpdateSupplierResponseTypePushChangeType)[keyof typeof UpdateSupplierResponseTypePushChangeType]; +export const ValidFor = { + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type ValidFor = (typeof ValidFor)[keyof typeof ValidFor]; +export const ValidForItems = { + AdjustmentTransactions: "adjustment-transactions", + ExpenseTransactionsChargeback: "expense-transactions.Chargeback", + ExpenseTransactionsPayment: "expense-transactions.Payment", + ExpenseTransactionsRefund: "expense-transactions.Refund", + ExpenseTransactionsReward: "expense-transactions.Reward", + ReimbursableExpenseTransactions: "reimbursable-expense-transactions", + TransferTransactions: "transfer-transactions", +} as const; +export type ValidForItems = (typeof ValidForItems)[keyof typeof ValidForItems]; +export const ValidTransactionTypes = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type ValidTransactionTypes = (typeof ValidTransactionTypes)[keyof typeof ValidTransactionTypes]; +export const ValidTransactionTypesItems = { + Chargeback: "Chargeback", + Payment: "Payment", + Refund: "Refund", + Reward: "Reward", +} as const; +export type ValidTransactionTypesItems = (typeof ValidTransactionTypesItems)[keyof typeof ValidTransactionTypesItems]; +export const WebLinksType = { + Social: "Social", + Unknown: "Unknown", + Website: "Website", +} as const; +export type WebLinksType = (typeof WebLinksType)[keyof typeof WebLinksType]; +export const WeblinkType = { + Social: "Social", + Unknown: "Unknown", + Website: "Website", +} as const; +export type WeblinkType = (typeof WeblinkType)[keyof typeof WeblinkType]; +export const ZeroAccountType = { + Asset: "Asset", + Equity: "Equity", + Expense: "Expense", + Income: "Income", + Liability: "Liability", + Unknown: "Unknown", +} as const; +export type ZeroAccountType = (typeof ZeroAccountType)[keyof typeof ZeroAccountType]; +export const ZeroAccountingAddressType = { + Billing: "Billing", + Delivery: "Delivery", + Unknown: "Unknown", +} as const; +export type ZeroAccountingAddressType = (typeof ZeroAccountingAddressType)[keyof typeof ZeroAccountingAddressType]; +export const ZeroBankAccountStatus = { + Active: "Active", + Archived: "Archived", + Pending: "Pending", + Unknown: "Unknown", +} as const; +export type ZeroBankAccountStatus = (typeof ZeroBankAccountStatus)[keyof typeof ZeroBankAccountStatus]; +export const ZeroBankAccountType = { + Credit: "Credit", + Debit: "Debit", + Unknown: "Unknown", +} as const; +export type ZeroBankAccountType = (typeof ZeroBankAccountType)[keyof typeof ZeroBankAccountType]; +export const ZeroDataConnectionSourceType = { + Accounting: "Accounting", + BankFeed: "BankFeed", + Banking: "Banking", + Commerce: "Commerce", + Expense: "Expense", + Other: "Other", + Unknown: "Unknown", +} as const; +export type ZeroDataConnectionSourceType = (typeof ZeroDataConnectionSourceType)[keyof typeof ZeroDataConnectionSourceType]; +export const ZeroDataConnectionStatus = { + Deauthorized: "Deauthorized", + Linked: "Linked", + PendingAuth: "PendingAuth", + Unlinked: "Unlinked", +} as const; +export type ZeroDataConnectionStatus = (typeof ZeroDataConnectionStatus)[keyof typeof ZeroDataConnectionStatus]; +export const ZeroDataTypes = { + AccountTransactions: "accountTransactions", + BalanceSheet: "balanceSheet", + BankAccounts: "bankAccounts", + BankTransactions: "bankTransactions", + BankingAccountBalances: "banking-accountBalances", + BankingAccounts: "banking-accounts", + BankingTransactionCategories: "banking-transactionCategories", + BankingTransactions: "banking-transactions", + BillCreditNotes: "billCreditNotes", + BillPayments: "billPayments", + Bills: "bills", + CashFlowStatement: "cashFlowStatement", + ChartOfAccounts: "chartOfAccounts", + CommerceCompanyInfo: "commerce-companyInfo", + CommerceCustomers: "commerce-customers", + CommerceDisputes: "commerce-disputes", + CommerceLocations: "commerce-locations", + CommerceOrders: "commerce-orders", + CommercePaymentMethods: "commerce-paymentMethods", + CommercePayments: "commerce-payments", + CommerceProductCategories: "commerce-productCategories", + CommerceProducts: "commerce-products", + CommerceTaxComponents: "commerce-taxComponents", + CommerceTransactions: "commerce-transactions", + Company: "company", + CreditNotes: "creditNotes", + Customers: "customers", + DirectCosts: "directCosts", + DirectIncomes: "directIncomes", + Invoices: "invoices", + ItemReceipts: "itemReceipts", + Items: "items", + JournalEntries: "journalEntries", + Journals: "journals", + PaymentMethods: "paymentMethods", + Payments: "payments", + ProfitAndLoss: "profitAndLoss", + PurchaseOrders: "purchaseOrders", + SalesOrders: "salesOrders", + Suppliers: "suppliers", + TaxRates: "taxRates", + TrackingCategories: "trackingCategories", + Transfers: "transfers", +} as const; +export type ZeroDataTypes = (typeof ZeroDataTypes)[keyof typeof ZeroDataTypes]; +export const ZeroDatasetStatus = { + AuthError: "AuthError", + Cancelled: "Cancelled", + Complete: "Complete", + FetchError: "FetchError", + Fetching: "Fetching", + Initial: "Initial", + InternalError: "InternalError", + MapError: "MapError", + MapQueued: "MapQueued", + Mapping: "Mapping", + NotSupported: "NotSupported", + PermissionsError: "PermissionsError", + PrerequisiteNotMet: "PrerequisiteNotMet", + Processing: "Processing", + ProcessingError: "ProcessingError", + ProcessingQueued: "ProcessingQueued", + Queued: "Queued", + RateLimitError: "RateLimitError", + Validating: "Validating", + ValidationError: "ValidationError", + ValidationQueued: "ValidationQueued", +} as const; +export type ZeroDatasetStatus = (typeof ZeroDatasetStatus)[keyof typeof ZeroDatasetStatus]; +export const ZeroErrorStatus = { + Active: "Active", + Resolved: "Resolved", +} as const; +export type ZeroErrorStatus = (typeof ZeroErrorStatus)[keyof typeof ZeroErrorStatus]; +export const ZeroIntegrationType = { + Bankfeeds: "bankfeeds", + Expenses: "expenses", +} as const; +export type ZeroIntegrationType = (typeof ZeroIntegrationType)[keyof typeof ZeroIntegrationType]; +export const ZeroPushChangeType = { + AttachmentUploaded: "AttachmentUploaded", + Created: "Created", + Deleted: "Deleted", + Modified: "Modified", + Unknown: "Unknown", +} as const; +export type ZeroPushChangeType = (typeof ZeroPushChangeType)[keyof typeof ZeroPushChangeType]; +export const ZeroPushOperationStatus = { + Failed: "Failed", + Pending: "Pending", + Success: "Success", + TimedOut: "TimedOut", +} as const; +export type ZeroPushOperationStatus = (typeof ZeroPushOperationStatus)[keyof typeof ZeroPushOperationStatus]; +export const ZeroSupplierStatus = { + Active: "Active", + Archived: "Archived", + Unknown: "Unknown", +} as const; +export type ZeroSupplierStatus = (typeof ZeroSupplierStatus)[keyof typeof ZeroSupplierStatus]; +export const ZeroTransactionStatus = { + Completed: "Completed", + Pending: "Pending", + PushError: "PushError", + Unknown: "Unknown", + ValidationError: "ValidationError", +} as const; +export type ZeroTransactionStatus = (typeof ZeroTransactionStatus)[keyof typeof ZeroTransactionStatus]; +export const ZeroType = { + Fax: "Fax", + Landline: "Landline", + Mobile: "Mobile", + Primary: "Primary", + Unknown: "Unknown", +} as const; +export type ZeroType = (typeof ZeroType)[keyof typeof ZeroType]; diff --git a/sync-for-expenses/src/sdk/models/_speakeasy_hoisted.ts b/sync-for-expenses/src/sdk/models/_speakeasy_hoisted.ts new file mode 100644 index 000000000..0d32cf1d3 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/_speakeasy_hoisted.ts @@ -0,0 +1,20 @@ +/* tslint:disable */ +/* eslint-disable */ + +import type * as shared from './index'; + + +export interface AccountPrototypeValidDataTypeLinks { + links?: Array | null; + property?: string | null; +} + +export interface ConnectionInfo {} + +export interface Content {} + +export interface Properties {} + +export interface SourceUrls {} + +export interface Tags {} diff --git a/sync-for-expenses/src/sdk/models/errors/codatsyncexpenseserror.ts b/sync-for-expenses/src/sdk/models/errors/codatsyncexpenseserror.ts index fceb467de..7f6905f13 100644 --- a/sync-for-expenses/src/sdk/models/errors/codatsyncexpenseserror.ts +++ b/sync-for-expenses/src/sdk/models/errors/codatsyncexpenseserror.ts @@ -1,35 +1,20 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** The base class for all HTTP error responses */ export class CodatSyncExpensesError extends Error { - /** HTTP status code */ - public readonly statusCode: number; - /** HTTP body */ - public readonly body: string; - /** HTTP headers */ - public readonly headers: Headers; - /** HTTP content type */ - public readonly contentType: string; - /** Raw response */ - public readonly rawResponse: Response; + readonly body: string; + readonly statusCode: number; + readonly contentType: string; + readonly headers: Headers; + readonly rawResponse: Response; - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - super(message); - this.statusCode = httpMeta.response.status; - this.body = httpMeta.body; - this.headers = httpMeta.response.headers; - this.contentType = httpMeta.response.headers.get("content-type") || ""; - this.rawResponse = httpMeta.response; - - this.name = "CodatSyncExpensesError"; - } + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message); + this.name = "CodatSyncExpensesError"; + this.body = httpMeta.body; + this.statusCode = httpMeta.response.status; + this.contentType = httpMeta.response.headers.get("content-type") ?? ""; + this.headers = httpMeta.response.headers; + this.rawResponse = httpMeta.response; + } } diff --git a/sync-for-expenses/src/sdk/models/errors/errormessage.ts b/sync-for-expenses/src/sdk/models/errors/errormessage.ts index 91cc428f9..eec9ab649 100644 --- a/sync-for-expenses/src/sdk/models/errors/errormessage.ts +++ b/sync-for-expenses/src/sdk/models/errors/errormessage.ts @@ -1,120 +1,38 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; -import { CodatSyncExpensesError } from "./codatsyncexpenseserror.js"; +import { CodatSyncExpensesError } from "./codatsyncexpenseserror"; +import type { ErrorMessageData } from "../ErrorMessage"; +import type { ErrorValidation } from "../shared/errorvalidation"; -/** - * Your `query` parameter was not correctly formed - */ -export type ErrorMessageData = { - /** - * The HTTP status code returned by the error. - */ - statusCode?: number | undefined; - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; -}; +export type { ErrorMessageData }; -/** - * Your `query` parameter was not correctly formed - */ export class ErrorMessage extends CodatSyncExpensesError { - /** - * Codat's service the returned the error. - */ - service?: string | undefined; - /** - * A brief description of the error. - */ - error?: string | undefined; - /** - * Unique identifier used to propagate to all downstream services and determine the source of the error. - */ - correlationId?: string | undefined; - /** - * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. - */ - validation?: shared.ErrorValidation | null | undefined; - /** - * `True` if the error occurred transiently and can be retried. - */ - canBeRetried?: string | undefined; - /** - * Machine readable error code used to automate processes based on the code returned. - */ - detailedErrorCode?: number | undefined; + service?: string | undefined; + error?: string | undefined; + correlationId?: string | undefined; + validation?: ErrorValidation | null | undefined; + canBeRetried?: string | undefined; + detailedErrorCode?: number | undefined; - /** The original data that was passed to this error instance. */ - data$: ErrorMessageData; + data$: ErrorMessageData; - constructor( - err: ErrorMessageData, - httpMeta: { response: Response; request: Request; body: string }, - ) { - const message = "message" in err && typeof err.message === "string" - ? err.message - : `API error occurred: ${JSON.stringify(err)}`; - super(message, httpMeta); - this.data$ = err; - if (err.service != null) this.service = err.service; - if (err.error != null) this.error = err.error; - if (err.correlationId != null) this.correlationId = err.correlationId; - if (err.validation != null) this.validation = err.validation; - if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; - if (err.detailedErrorCode != null) { - this.detailedErrorCode = err.detailedErrorCode; + constructor( + err: ErrorMessageData, + httpMeta: { response: Response; request: Request; body: string }, + ) { + const data = err as ErrorMessageData & { message?: unknown }; + const message = typeof data.message === "string" + ? data.message + : `API error occurred: ${JSON.stringify(err)}`; + super(message, httpMeta); + this.data$ = err; + if (err.service != null) this.service = err.service; + if (err.error != null) this.error = err.error; + if (err.correlationId != null) this.correlationId = err.correlationId; + if (err.validation != null) this.validation = err.validation; + if (err.canBeRetried != null) this.canBeRetried = err.canBeRetried; + if (err.detailedErrorCode != null) this.detailedErrorCode = err.detailedErrorCode; + this.name = "ErrorMessage"; } - - this.name = "ErrorMessage"; - } } - -/** @internal */ -export const ErrorMessage$inboundSchema: z.ZodType< - ErrorMessage, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.number().int().optional(), - service: z.string().optional(), - error: z.string().optional(), - correlationId: z.string().optional(), - validation: z.nullable(shared.ErrorValidation$inboundSchema).optional(), - canBeRetried: z.string().optional(), - detailedErrorCode: z.number().int().optional(), - request$: z.instanceof(Request), - response$: z.instanceof(Response), - body$: z.string(), -}) - .transform((v) => { - return new ErrorMessage(v, { - request: v.request$, - response: v.response$, - body: v.body$, - }); - }); diff --git a/sync-for-expenses/src/sdk/models/errors/httpclienterrors.ts b/sync-for-expenses/src/sdk/models/errors/httpclienterrors.ts index b34f61212..0bfc5af09 100644 --- a/sync-for-expenses/src/sdk/models/errors/httpclienterrors.ts +++ b/sync-for-expenses/src/sdk/models/errors/httpclienterrors.ts @@ -1,62 +1,47 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * Base class for all HTTP errors. - */ export class HTTPClientError extends Error { - /** The underlying cause of the error. */ - override readonly cause: unknown; - override name = "HTTPClientError"; - constructor(message: string, opts?: { cause?: unknown }) { - let msg = message; - if (opts?.cause) { - msg += `: ${opts.cause}`; - } + readonly cause: unknown; - super(msg, opts); - // In older runtimes, the cause field would not have been assigned through - // the super() call. - if (typeof this.cause === "undefined") { - this.cause = opts?.cause; + constructor(message: string, opts?: { cause?: unknown }) { + super(message); + this.name = "HTTPClientError"; + this.cause = opts?.cause; } - } } -/** - * An error to capture unrecognised or unexpected errors when making HTTP calls. - */ export class UnexpectedClientError extends HTTPClientError { - override name = "UnexpectedClientError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "UnexpectedClientError"; + } } -/** - * An error that is raised when any inputs used to create a request are invalid. - */ export class InvalidRequestError extends HTTPClientError { - override name = "InvalidRequestError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "InvalidRequestError"; + } } -/** - * An error that is raised when a HTTP request was aborted by the client error. - */ export class RequestAbortedError extends HTTPClientError { - override readonly name = "RequestAbortedError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestAbortedError"; + } } -/** - * An error that is raised when a HTTP request timed out due to an AbortSignal - * signal timeout. - */ export class RequestTimeoutError extends HTTPClientError { - override readonly name = "RequestTimeoutError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "RequestTimeoutError"; + } } -/** - * An error that is raised when a HTTP client is unable to make a request to - * a server. - */ export class ConnectionError extends HTTPClientError { - override readonly name = "ConnectionError"; + constructor(message: string, opts?: { cause?: unknown }) { + super(message, opts); + this.name = "ConnectionError"; + } } diff --git a/sync-for-expenses/src/sdk/models/errors/index.ts b/sync-for-expenses/src/sdk/models/errors/index.ts index 7d14c1126..757475262 100644 --- a/sync-for-expenses/src/sdk/models/errors/index.ts +++ b/sync-for-expenses/src/sdk/models/errors/index.ts @@ -1,10 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./codatsyncexpenseserror.js"; -export * from "./errormessage.js"; -export * from "./httpclienterrors.js"; -export * from "./responsevalidationerror.js"; -export * from "./sdkerror.js"; -export * from "./sdkvalidationerror.js"; +export * from './codatsyncexpenseserror'; +export * from './errormessage'; +export * from './httpclienterrors'; +export * from './responsevalidationerror'; +export * from './sdkerror'; +export * from './sdkvalidationerror'; diff --git a/sync-for-expenses/src/sdk/models/errors/responsevalidationerror.ts b/sync-for-expenses/src/sdk/models/errors/responsevalidationerror.ts index ea5e04dba..3dbf7d1d0 100644 --- a/sync-for-expenses/src/sdk/models/errors/responsevalidationerror.ts +++ b/sync-for-expenses/src/sdk/models/errors/responsevalidationerror.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { CodatSyncExpensesError } from "./codatsyncexpenseserror.js"; -import { formatZodError } from "./sdkvalidationerror.js"; +import { CodatSyncExpensesError } from "./codatsyncexpenseserror"; export class ResponseValidationError extends CodatSyncExpensesError { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; + readonly cause: unknown; + readonly rawMessage: unknown; + readonly rawValue: unknown; - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - constructor( - message: string, - extra: { - response: Response; - request: Request; - body: string; - cause: unknown; - rawValue: unknown; - rawMessage: unknown; - }, - ) { - super(message, extra); - this.name = "ResponseValidationError"; - this.cause = extra.cause; - this.rawValue = extra.rawValue; - this.rawMessage = extra.rawMessage; - } + constructor( + message: string, + extra: { response: Response; request: Request; body: string; cause: unknown; rawValue: unknown; rawMessage: unknown }, + ) { + super(message, extra); + this.name = "ResponseValidationError"; + this.cause = extra.cause; + this.rawMessage = extra.rawMessage; + this.rawValue = extra.rawValue; + } - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + pretty(): string { + return this.message; } - } } diff --git a/sync-for-expenses/src/sdk/models/errors/sdkerror.ts b/sync-for-expenses/src/sdk/models/errors/sdkerror.ts index dc0c69706..ca9004e9a 100644 --- a/sync-for-expenses/src/sdk/models/errors/sdkerror.ts +++ b/sync-for-expenses/src/sdk/models/errors/sdkerror.ts @@ -1,40 +1,11 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import { CodatSyncExpensesError } from "./codatsyncexpenseserror.js"; +import { CodatSyncExpensesError } from "./codatsyncexpenseserror"; -/** The fallback error class if no more specific error class is matched */ export class SDKError extends CodatSyncExpensesError { - constructor( - message: string, - httpMeta: { - response: Response; - request: Request; - body: string; - }, - ) { - if (message) { - message += `: `; + constructor(message: string, httpMeta: { response: Response; request: Request; body: string }) { + super(message, httpMeta); + this.name = "SDKError"; } - message += `Status ${httpMeta.response.status}`; - const contentType = httpMeta.response.headers.get("content-type") || `""`; - if (contentType !== "application/json") { - message += ` Content-Type ${ - contentType.includes(" ") ? `"${contentType}"` : contentType - }`; - } - const body = httpMeta.body || `""`; - message += body.length > 100 ? "\n" : ". "; - let bodyDisplay = body; - if (body.length > 10000) { - const truncated = body.substring(0, 10000); - const remaining = body.length - 10000; - bodyDisplay = `${truncated}...and ${remaining} more chars`; - } - message += `Body: ${bodyDisplay}`; - message = message.trim(); - super(message, httpMeta); - this.name = "SDKError"; - } } diff --git a/sync-for-expenses/src/sdk/models/errors/sdkvalidationerror.ts b/sync-for-expenses/src/sdk/models/errors/sdkvalidationerror.ts index 6826e1208..23a011c8c 100644 --- a/sync-for-expenses/src/sdk/models/errors/sdkvalidationerror.ts +++ b/sync-for-expenses/src/sdk/models/errors/sdkvalidationerror.ts @@ -1,109 +1,26 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; +/* tslint:disable */ +/* eslint-disable */ export class SDKValidationError extends Error { - /** - * The raw value that failed validation. - */ - public readonly rawValue: unknown; - - /** - * The raw message that failed validation. - */ - public readonly rawMessage: unknown; - - // Allows for backwards compatibility for `instanceof` checks of `ResponseValidationError` - static override [Symbol.hasInstance]( - instance: unknown, - ): instance is SDKValidationError { - if (!(instance instanceof Error)) return false; - if (!("rawValue" in instance)) return false; - if (!("rawMessage" in instance)) return false; - if (!("pretty" in instance)) return false; - if (typeof instance.pretty !== "function") return false; - return true; - } - - constructor(message: string, cause: unknown, rawValue: unknown) { - super(`${message}: ${cause}`); - this.name = "SDKValidationError"; - this.cause = cause; - this.rawValue = rawValue; - this.rawMessage = message; - } - - /** - * Return a pretty-formatted error message if the underlying validation error - * is a ZodError or some other recognized error type, otherwise return the - * default error message. - */ - public pretty(): string { - if (this.cause instanceof z.ZodError) { - return `${this.rawMessage}\n${formatZodError(this.cause)}`; - } else { - return this.toString(); + readonly cause: unknown; + readonly rawValue: unknown; + readonly rawMessage: unknown; + + constructor(message: string, cause: unknown, rawValue: unknown) { + super(message); + this.name = "SDKValidationError"; + this.cause = cause; + this.rawValue = rawValue; + this.rawMessage = message; } - } -} -export function formatZodError(err: z.ZodError, level = 0): string { - let pre = " ".repeat(level); - pre = level > 0 ? `│${pre}` : pre; - pre += " ".repeat(level); - - let message = ""; - const append = (str: string) => (message += `\n${pre}${str}`); - - const len = err.issues.length; - const headline = len === 1 ? `${len} issue found` : `${len} issues found`; - - if (len) { - append(`┌ ${headline}:`); - } - - for (const issue of err.issues) { - let path = issue.path.join("."); - path = path ? `.${path}` : ""; - append(`│ • [${path}]: ${issue.message} (${issue.code})`); - switch (issue.code) { - case "invalid_literal": - case "invalid_type": { - append(`│ Want: ${issue.expected}`); - append(`│ Got: ${issue.received}`); - break; - } - case "unrecognized_keys": { - append(`│ Keys: ${issue.keys.join(", ")}`); - break; - } - case "invalid_enum_value": { - append(`│ Allowed: ${issue.options.join(", ")}`); - append(`│ Got: ${issue.received}`); - break; - } - case "invalid_union_discriminator": { - append(`│ Allowed: ${issue.options.join(", ")}`); - break; - } - case "invalid_union": { - const len = issue.unionErrors.length; - append( - `│ ✖︎ Attemped to deserialize into one of ${len} union members:`, - ); - issue.unionErrors.forEach((err, i) => { - append(`│ ✖︎ Member ${i + 1} of ${len}`); - append(`${formatZodError(err, level + 1)}`); - }); - } + pretty(): string { + return this.message; } - } - - if (err.issues.length) { - append(`└─*`); - } +} - return message.slice(1); +export function formatZodError(err: unknown, level?: number): string { + void err; + void level; + return ""; } diff --git a/sync-for-expenses/src/sdk/models/index.ts b/sync-for-expenses/src/sdk/models/index.ts new file mode 100644 index 000000000..b424f2dc8 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/index.ts @@ -0,0 +1,183 @@ +/* tslint:disable */ +/* eslint-disable */ +export * from './Account'; +export * from './shared/accountmappinginfo'; +export * from './shared/accountprototype'; +export * from './shared/accountreference'; +export * from './AccountReference1'; +export * from './shared/accountstatus'; +export * from './shared/accounttype'; +export * from './shared/accountingaddress'; +export * from './shared/accountingaddresstype'; +export * from './shared/adjustmenttransactionline'; +export * from './shared/adjustmenttransactionrequest'; +export * from './shared/adjustmenttransactionresponse'; +export * from './shared/apaccountref'; +export * from './shared/attachment'; +export * from './shared/bankaccount'; +export * from './shared/bankaccountdetails'; +export * from './BankAccountPrototype'; +export * from './shared/bankaccountreference'; +export * from './shared/bankaccountstatus'; +export * from './shared/clientratelimitwebhook'; +export * from './shared/clientratelimitwebhookpayload'; +export * from './shared/companies'; +export * from './shared/company'; +export * from './shared/companyconfiguration'; +export * from './CompanyDetails'; +export * from './shared/companyinformation'; +export * from './shared/companyreference'; +export * from './shared/companyreferencelinks'; +export * from './shared/companyrequestbody'; +export * from './shared/companysyncstatus'; +export * from './shared/companyupdaterequest'; +export * from './shared/connection'; +export * from './shared/connections'; +export * from './shared/contact'; +export * from './shared/createaccountresponse'; +export * from './CreateAccountResponseAllOfData'; +export * from './shared/createbankaccountresponse'; +export * from './CreateBankAccountResponseAllOfData'; +export * from './operations/createconnectionrequestbody'; +export * from './shared/createcustomerresponse'; +export * from './CreateCustomerResponseAllOfData'; +export * from './shared/createexpenseresponse'; +export * from './shared/createreimbursableexpenseresponse'; +export * from './shared/createsupplierresponse'; +export * from './CreateSupplierResponseAllOfData'; +export * from './shared/customer'; +export * from './shared/customerdetails'; +export * from './shared/customerstatus'; +export * from './shared/customers'; +export * from './shared/dataconnectionerror'; +export * from './shared/dataconnectionstatus'; +export * from './shared/datastatus'; +export * from './DataStatuses'; +export * from './shared/datatype'; +export * from './shared/definitiontransaction'; +export * from './ErrorMessage'; +export * from './shared/errorvalidation'; +export * from './shared/errorvalidationitem'; +export * from './shared/expensecontactref'; +export * from './shared/expensetransaction'; +export * from './shared/expensetransactionline'; +export * from './shared/expensessyncwebhook'; +export * from './shared/expensessyncwebhookpayload'; +export * from './shared/halref'; +export * from './shared/integrationtype'; +export * from './shared/invoiceto'; +export * from './shared/itemref'; +export * from './shared/items'; +export * from './shared/links'; +export * from './shared/mappingoptions'; +export * from './shared/metadata'; +export * from './Model3'; +export * from './PagingInfo'; +export * from './shared/phonenumberitems'; +export * from './shared/pulloperation'; +export * from './shared/pulloperations'; +export * from './shared/pushchangetype'; +export * from './shared/pushfieldvalidation'; +export * from './shared/pushoperation'; +export * from './shared/pushoperationchange'; +export * from './shared/pushoperationref'; +export * from './shared/pushoperationstatus'; +export * from './shared/pushoperations'; +export * from './shared/pushoption'; +export * from './shared/pushoptionchoice'; +export * from './shared/pushoptionproperty'; +export * from './shared/pushoptiontype'; +export * from './shared/pushvalidationinfo'; +export * from './shared/recordref'; +export * from './shared/reimbursableexpensetransaction'; +export * from './shared/reimbursableexpensetransactionline'; +export * from './shared/reimbursementcontactref'; +export * from './shared/status'; +export * from './shared/supplementaldata'; +export * from './shared/supplier'; +export * from './shared/supplierdetails'; +export * from './shared/supplierstatus'; +export * from './shared/suppliers'; +export * from './SyncCompleteWebhook'; +export * from './SyncCompleteWebhookData'; +export * from './SyncFailedWebhook'; +export * from './SyncFailedWebhookData'; +export * from './SyncInitiated'; +export * from './shared/taxratemappinginfo'; +export * from './shared/trackingcategorymappinginfo'; +export * from './shared/trackingref'; +export * from './shared/trackingrefadjustmenttransaction'; +export * from './shared/transaction'; +export * from './shared/transactionstatus'; +export * from './shared/transactions'; +export * from './shared/transfertransactionrequest'; +export * from './TransferTransactionRequestFrom'; +export * from './TransferTransactionRequestTo'; +export * from './shared/transfertransactionresponse'; +export * from './UpdateConnection'; +export * from './shared/updatecustomerresponse'; +export * from './UpdateCustomerResponseAllOfData'; +export * from './shared/updateexpenserequest'; +export * from './shared/updateexpenseresponse'; +export * from './UpdateReimbursableExpenseTransactionRequest'; +export * from './shared/updatesupplierresponse'; +export * from './UpdateSupplierResponseAllOfData'; +export * from './shared/validdatatypelinks'; +export * from './shared/validation'; +export * from './shared/validationitem'; +export * from './shared/weblink'; +export * from './shared/codatfile'; +export * from './shared/attachmentupload'; +export * from './_speakeasy_enums'; +export * from './_speakeasy_hoisted'; +export type { Security } from '../../lib/sdkconfig'; + +export type { ListCompaniesRequest } from './operations/listcompanies'; +export type { GetCompanyRequest } from './operations/getcompany'; +export type { ReplaceCompanyRequest } from './operations/replacecompany'; +export type { UpdateCompanyRequest } from './operations/updatecompany'; +export type { DeleteCompanyRequest } from './operations/deletecompany'; +export type { ListConnectionsRequest } from './operations/listconnections'; +export type { CreateConnectionRequest } from './operations/createconnection'; +export type { GetConnectionRequest } from './operations/getconnection'; +export type { UnlinkConnectionRequest } from './operations/unlinkconnection'; +export type { DeleteConnectionRequest } from './operations/deleteconnection'; +export type { CreatePartnerExpenseConnectionRequest } from './operations/createpartnerexpenseconnection'; +export type { GetCompanyInfoRequest } from './operations/getcompanyinfo'; +export type { GetCompanyConfigurationRequest } from './operations/getcompanyconfiguration'; +export type { SetCompanyConfigurationRequest } from './operations/setcompanyconfiguration'; +export type { GetMappingOptionsRequest } from './operations/getmappingoptions'; +export type { GetLastSuccessfulSyncRequest } from './operations/getlastsuccessfulsync'; +export type { GetLatestSyncRequest } from './operations/getlatestsync'; +export type { ListSyncsRequest } from './operations/listsyncs'; +export type { GetSyncByIdRequest } from './operations/getsyncbyid'; +export type { ListSyncTransactionsRequest } from './operations/listsynctransactions'; +export type { GetSyncTransactionRequest } from './operations/getsynctransaction'; +export type { CreateExpenseTransactionRequest } from './operations/createexpensetransaction'; +export type { UpdateExpenseTransactionRequest } from './operations/updateexpensetransaction'; +export type { CreateTransferTransactionRequest } from './operations/createtransfertransaction'; +export type { CreateAdjustmentTransactionRequest } from './operations/createadjustmenttransaction'; +export type { CreateReimbursableExpenseTransactionRequest } from './operations/createreimbursableexpensetransaction'; +export type { UploadExpenseAttachmentRequest } from './operations/uploadexpenseattachment'; +export type { RefreshAllDataTypesRequest } from './operations/refreshalldatatypes'; +export type { GetDataStatusRequest } from './operations/getdatastatus'; +export type { RefreshDataTypeRequest } from './operations/refreshdatatype'; +export type { ListPullOperationsRequest } from './operations/listpulloperations'; +export type { GetPullOperationRequest } from './operations/getpulloperation'; +export type { ListPushOperationsRequest } from './operations/listpushoperations'; +export type { GetPushOperationRequest } from './operations/getpushoperation'; +export type { CreateAccountRequest } from './operations/createaccount'; +export type { GetCreateChartOfAccountsModelRequest } from './operations/getcreatechartofaccountsmodel'; +export type { CreateBankAccountRequest } from './operations/createbankaccount'; +export type { GetCreateBankAccountsModelRequest } from './operations/getcreatebankaccountsmodel'; +export type { ListCustomersRequest } from './operations/listcustomers'; +export type { GetCustomerRequest } from './operations/getcustomer'; +export type { CreateCustomerRequest } from './operations/createcustomer'; +export type { UpdateCustomerRequest } from './operations/updatecustomer'; +export type { ListSuppliersRequest } from './operations/listsuppliers'; +export type { GetSupplierRequest } from './operations/getsupplier'; +export type { CreateSupplierRequest } from './operations/createsupplier'; +export type { UpdateSupplierRequest } from './operations/updatesupplier'; + +export * as operations from './operations'; +export * as shared from './shared'; diff --git a/sync-for-expenses/src/sdk/models/operations/createaccount.ts b/sync-for-expenses/src/sdk/models/operations/createaccount.ts index d8d3f68e1..e54daa854 100644 --- a/sync-for-expenses/src/sdk/models/operations/createaccount.ts +++ b/sync-for-expenses/src/sdk/models/operations/createaccount.ts @@ -1,56 +1,12 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import type { AccountPrototype } from '../shared/accountprototype'; +/* eslint-disable */ -export type CreateAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - accountPrototype?: shared.AccountPrototype | undefined; -}; - -/** @internal */ -export type CreateAccountRequest$Outbound = { - companyId: string; - connectionId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - accountPrototype?: shared.AccountPrototype$Outbound | undefined; -}; - -/** @internal */ -export const CreateAccountRequest$outboundSchema: z.ZodType< - CreateAccountRequest$Outbound, - z.ZodTypeDef, - CreateAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - accountPrototype: shared.AccountPrototype$outboundSchema.optional(), -}); - -export function createAccountRequestToJSON( - createAccountRequest: CreateAccountRequest, -): string { - return JSON.stringify( - CreateAccountRequest$outboundSchema.parse(createAccountRequest), - ); +export interface CreateAccountRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + accountPrototype?: AccountPrototype | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/createadjustmenttransaction.ts b/sync-for-expenses/src/sdk/models/operations/createadjustmenttransaction.ts index 9282464cc..b4f850594 100644 --- a/sync-for-expenses/src/sdk/models/operations/createadjustmenttransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/createadjustmenttransaction.ts @@ -1,46 +1,19 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { AdjustmentTransactionRequest } from '../shared/adjustmenttransactionrequest'; +/* eslint-disable */ -export type CreateAdjustmentTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: Array | undefined; -}; - -/** @internal */ -export type CreateAdjustmentTransactionRequest$Outbound = { - companyId: string; - RequestBody?: Array | undefined; -}; +export interface CreateAdjustmentTransactionRequest { + companyId: string; + requestBody?: Array; +} -/** @internal */ -export const CreateAdjustmentTransactionRequest$outboundSchema: z.ZodType< - CreateAdjustmentTransactionRequest$Outbound, - z.ZodTypeDef, - CreateAdjustmentTransactionRequest -> = z.object({ - companyId: z.string(), - requestBody: z.array(shared.AdjustmentTransactionRequest$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); +export interface AdjustmentTransactionCreateRequestBody { + companyId: string; + requestBody?: any; +} -export function createAdjustmentTransactionRequestToJSON( - createAdjustmentTransactionRequest: CreateAdjustmentTransactionRequest, -): string { - return JSON.stringify( - CreateAdjustmentTransactionRequest$outboundSchema.parse( - createAdjustmentTransactionRequest, - ), - ); +export interface CreateAdjustmentTransactionRequestBody { + companyId: string; + requestBody?: any; } diff --git a/sync-for-expenses/src/sdk/models/operations/createbankaccount.ts b/sync-for-expenses/src/sdk/models/operations/createbankaccount.ts index dde96c24e..407fca8f3 100644 --- a/sync-for-expenses/src/sdk/models/operations/createbankaccount.ts +++ b/sync-for-expenses/src/sdk/models/operations/createbankaccount.ts @@ -1,61 +1,12 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { BankAccount } from '../shared/bankaccount'; +/* eslint-disable */ -export type CreateBankAccountRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - bankAccount?: shared.BankAccount | null | undefined; -}; - -/** @internal */ -export type CreateBankAccountRequest$Outbound = { - companyId: string; - connectionId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - BankAccount?: shared.BankAccount$Outbound | null | undefined; -}; - -/** @internal */ -export const CreateBankAccountRequest$outboundSchema: z.ZodType< - CreateBankAccountRequest$Outbound, - z.ZodTypeDef, - CreateBankAccountRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - bankAccount: z.nullable(shared.BankAccount$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - bankAccount: "BankAccount", - }); -}); - -export function createBankAccountRequestToJSON( - createBankAccountRequest: CreateBankAccountRequest, -): string { - return JSON.stringify( - CreateBankAccountRequest$outboundSchema.parse(createBankAccountRequest), - ); +export interface CreateBankAccountRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + bankAccount?: BankAccount | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/createconnection.ts b/sync-for-expenses/src/sdk/models/operations/createconnection.ts index dc5bcac12..99117b45a 100644 --- a/sync-for-expenses/src/sdk/models/operations/createconnection.ts +++ b/sync-for-expenses/src/sdk/models/operations/createconnection.ts @@ -1,74 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; +import type { CreateConnectionRequestBody } from './createconnectionrequestbody'; +/* eslint-disable */ -export type CreateConnectionRequestBody = { - /** - * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. - */ - platformKey?: string | undefined; -}; - -export type CreateConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: CreateConnectionRequestBody | undefined; -}; - -/** @internal */ -export type CreateConnectionRequestBody$Outbound = { - platformKey?: string | undefined; -}; - -/** @internal */ -export const CreateConnectionRequestBody$outboundSchema: z.ZodType< - CreateConnectionRequestBody$Outbound, - z.ZodTypeDef, - CreateConnectionRequestBody -> = z.object({ - platformKey: z.string().optional(), -}); - -export function createConnectionRequestBodyToJSON( - createConnectionRequestBody: CreateConnectionRequestBody, -): string { - return JSON.stringify( - CreateConnectionRequestBody$outboundSchema.parse( - createConnectionRequestBody, - ), - ); -} - -/** @internal */ -export type CreateConnectionRequest$Outbound = { - companyId: string; - RequestBody?: CreateConnectionRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const CreateConnectionRequest$outboundSchema: z.ZodType< - CreateConnectionRequest$Outbound, - z.ZodTypeDef, - CreateConnectionRequest -> = z.object({ - companyId: z.string(), - requestBody: z.lazy(() => CreateConnectionRequestBody$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function createConnectionRequestToJSON( - createConnectionRequest: CreateConnectionRequest, -): string { - return JSON.stringify( - CreateConnectionRequest$outboundSchema.parse(createConnectionRequest), - ); +export interface CreateConnectionRequest { + companyId: string; + requestBody?: CreateConnectionRequestBody | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/createconnectionrequestbody.ts b/sync-for-expenses/src/sdk/models/operations/createconnectionrequestbody.ts new file mode 100644 index 000000000..1d0026a1c --- /dev/null +++ b/sync-for-expenses/src/sdk/models/operations/createconnectionrequestbody.ts @@ -0,0 +1,83 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CreateConnectionRequestBody + */ +export interface CreateConnectionRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +/** + * Check if a given object implements the CreateConnectionRequestBody interface. + */ +export function instanceOfCreateConnectionRequestBody(value: object): value is CreateConnectionRequestBody { + return true; +} + +export function CreateConnectionRequestBodyFromJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyFromJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateConnectionRequestBody { + if (json == null) { + return json; + } + return { + + 'platformKey': json['platformKey'] == null ? undefined : json['platformKey'], + }; +} + +export function CreateConnectionRequestBodyToJSON(json: any): CreateConnectionRequestBody { + return CreateConnectionRequestBodyToJSONTyped(json, false); +} + +export function CreateConnectionRequestBodyToJSONTyped(value?: CreateConnectionRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'platformKey': value['platformKey'], + }; +} + + +export interface ConnectionCreateRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} + +export interface CreateConnectionCreateConnectionRequestBody { + /** + * A unique 4-letter key to represent a platform in each integration. View [accounting](https://docs.codat.io/integrations/accounting/overview#platform-keys), [banking](https://docs.codat.io/integrations/banking/overview#platform-keys), and [commerce](https://docs.codat.io/integrations/commerce/overview#platform-keys) platform keys. + * @type {string} + * @memberof CreateConnectionRequestBody + */ + platformKey?: string; +} diff --git a/sync-for-expenses/src/sdk/models/operations/createcustomer.ts b/sync-for-expenses/src/sdk/models/operations/createcustomer.ts index 57054a54b..17fc643d6 100644 --- a/sync-for-expenses/src/sdk/models/operations/createcustomer.ts +++ b/sync-for-expenses/src/sdk/models/operations/createcustomer.ts @@ -1,61 +1,12 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { Customer } from '../shared/customer'; +/* eslint-disable */ -export type CreateCustomerRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - customer?: shared.Customer | null | undefined; -}; - -/** @internal */ -export type CreateCustomerRequest$Outbound = { - companyId: string; - connectionId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - Customer?: shared.Customer$Outbound | null | undefined; -}; - -/** @internal */ -export const CreateCustomerRequest$outboundSchema: z.ZodType< - CreateCustomerRequest$Outbound, - z.ZodTypeDef, - CreateCustomerRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - customer: z.nullable(shared.Customer$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - customer: "Customer", - }); -}); - -export function createCustomerRequestToJSON( - createCustomerRequest: CreateCustomerRequest, -): string { - return JSON.stringify( - CreateCustomerRequest$outboundSchema.parse(createCustomerRequest), - ); +export interface CreateCustomerRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + customer?: Customer | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/createexpensetransaction.ts b/sync-for-expenses/src/sdk/models/operations/createexpensetransaction.ts index 4e9f5f6af..126a35014 100644 --- a/sync-for-expenses/src/sdk/models/operations/createexpensetransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/createexpensetransaction.ts @@ -1,45 +1,19 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { ExpenseTransaction } from '../shared/expensetransaction'; +/* eslint-disable */ -export type CreateExpenseTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: Array | undefined; -}; - -/** @internal */ -export type CreateExpenseTransactionRequest$Outbound = { - companyId: string; - RequestBody?: Array | undefined; -}; +export interface CreateExpenseTransactionRequest { + companyId: string; + requestBody?: Array; +} -/** @internal */ -export const CreateExpenseTransactionRequest$outboundSchema: z.ZodType< - CreateExpenseTransactionRequest$Outbound, - z.ZodTypeDef, - CreateExpenseTransactionRequest -> = z.object({ - companyId: z.string(), - requestBody: z.array(shared.ExpenseTransaction$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); +export interface CreateExpenseTransactionRequestBody { + companyId: string; + requestBody?: any; +} -export function createExpenseTransactionRequestToJSON( - createExpenseTransactionRequest: CreateExpenseTransactionRequest, -): string { - return JSON.stringify( - CreateExpenseTransactionRequest$outboundSchema.parse( - createExpenseTransactionRequest, - ), - ); +export interface ExpenseTransactionCreateRequestBody { + companyId: string; + requestBody?: any; } diff --git a/sync-for-expenses/src/sdk/models/operations/createpartnerexpenseconnection.ts b/sync-for-expenses/src/sdk/models/operations/createpartnerexpenseconnection.ts index 7b71c8039..ab72c0bd6 100644 --- a/sync-for-expenses/src/sdk/models/operations/createpartnerexpenseconnection.ts +++ b/sync-for-expenses/src/sdk/models/operations/createpartnerexpenseconnection.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type CreatePartnerExpenseConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type CreatePartnerExpenseConnectionRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const CreatePartnerExpenseConnectionRequest$outboundSchema: z.ZodType< - CreatePartnerExpenseConnectionRequest$Outbound, - z.ZodTypeDef, - CreatePartnerExpenseConnectionRequest -> = z.object({ - companyId: z.string(), -}); - -export function createPartnerExpenseConnectionRequestToJSON( - createPartnerExpenseConnectionRequest: CreatePartnerExpenseConnectionRequest, -): string { - return JSON.stringify( - CreatePartnerExpenseConnectionRequest$outboundSchema.parse( - createPartnerExpenseConnectionRequest, - ), - ); +export interface CreatePartnerExpenseConnectionRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/createreimbursableexpensetransaction.ts b/sync-for-expenses/src/sdk/models/operations/createreimbursableexpensetransaction.ts index 996da57c9..076a00e9e 100644 --- a/sync-for-expenses/src/sdk/models/operations/createreimbursableexpensetransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/createreimbursableexpensetransaction.ts @@ -1,50 +1,19 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { ReimbursableExpenseTransaction } from '../shared/reimbursableexpensetransaction'; +/* eslint-disable */ -export type CreateReimbursableExpenseTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - requestBody?: Array | undefined; -}; - -/** @internal */ -export type CreateReimbursableExpenseTransactionRequest$Outbound = { - companyId: string; - RequestBody?: - | Array - | undefined; -}; +export interface CreateReimbursableExpenseTransactionRequest { + companyId: string; + requestBody?: Array; +} -/** @internal */ -export const CreateReimbursableExpenseTransactionRequest$outboundSchema: - z.ZodType< - CreateReimbursableExpenseTransactionRequest$Outbound, - z.ZodTypeDef, - CreateReimbursableExpenseTransactionRequest - > = z.object({ - companyId: z.string(), - requestBody: z.array(shared.ReimbursableExpenseTransaction$outboundSchema) - .optional(), - }).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); - }); +export interface CreateReimbursableExpenseTransactionRequestBody { + companyId: string; + requestBody?: any; +} -export function createReimbursableExpenseTransactionRequestToJSON( - createReimbursableExpenseTransactionRequest: - CreateReimbursableExpenseTransactionRequest, -): string { - return JSON.stringify( - CreateReimbursableExpenseTransactionRequest$outboundSchema.parse( - createReimbursableExpenseTransactionRequest, - ), - ); +export interface ReimbursableExpenseTransactionCreateRequestBody { + companyId: string; + requestBody?: any; } diff --git a/sync-for-expenses/src/sdk/models/operations/createsupplier.ts b/sync-for-expenses/src/sdk/models/operations/createsupplier.ts index 8022daa8c..7fb845ec4 100644 --- a/sync-for-expenses/src/sdk/models/operations/createsupplier.ts +++ b/sync-for-expenses/src/sdk/models/operations/createsupplier.ts @@ -1,61 +1,12 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { Supplier } from '../shared/supplier'; +/* eslint-disable */ -export type CreateSupplierRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - supplier?: shared.Supplier | null | undefined; -}; - -/** @internal */ -export type CreateSupplierRequest$Outbound = { - companyId: string; - connectionId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - Supplier?: shared.Supplier$Outbound | null | undefined; -}; - -/** @internal */ -export const CreateSupplierRequest$outboundSchema: z.ZodType< - CreateSupplierRequest$Outbound, - z.ZodTypeDef, - CreateSupplierRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - supplier: z.nullable(shared.Supplier$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - supplier: "Supplier", - }); -}); - -export function createSupplierRequestToJSON( - createSupplierRequest: CreateSupplierRequest, -): string { - return JSON.stringify( - CreateSupplierRequest$outboundSchema.parse(createSupplierRequest), - ); +export interface CreateSupplierRequest { + companyId: string; + connectionId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + supplier?: Supplier | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/createtransfertransaction.ts b/sync-for-expenses/src/sdk/models/operations/createtransfertransaction.ts index ca8dae247..2604ca547 100644 --- a/sync-for-expenses/src/sdk/models/operations/createtransfertransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/createtransfertransaction.ts @@ -1,54 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { TransferTransactionRequest } from '../shared/transfertransactionrequest'; +/* eslint-disable */ -export type CreateTransferTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * The unique identifier for your SMB's transaction. - */ - transactionId: string; - transferTransactionRequest?: shared.TransferTransactionRequest | undefined; -}; - -/** @internal */ -export type CreateTransferTransactionRequest$Outbound = { - companyId: string; - transactionId: string; - TransferTransactionRequest?: - | shared.TransferTransactionRequest$Outbound - | undefined; -}; - -/** @internal */ -export const CreateTransferTransactionRequest$outboundSchema: z.ZodType< - CreateTransferTransactionRequest$Outbound, - z.ZodTypeDef, - CreateTransferTransactionRequest -> = z.object({ - companyId: z.string(), - transactionId: z.string(), - transferTransactionRequest: shared.TransferTransactionRequest$outboundSchema - .optional(), -}).transform((v) => { - return remap$(v, { - transferTransactionRequest: "TransferTransactionRequest", - }); -}); - -export function createTransferTransactionRequestToJSON( - createTransferTransactionRequest: CreateTransferTransactionRequest, -): string { - return JSON.stringify( - CreateTransferTransactionRequest$outboundSchema.parse( - createTransferTransactionRequest, - ), - ); +export interface CreateTransferTransactionRequest { + companyId: string; + transactionId: string; + transferTransactionRequest?: TransferTransactionRequest | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/deletecompany.ts b/sync-for-expenses/src/sdk/models/operations/deletecompany.ts index dbe555534..84680d5e6 100644 --- a/sync-for-expenses/src/sdk/models/operations/deletecompany.ts +++ b/sync-for-expenses/src/sdk/models/operations/deletecompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type DeleteCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const DeleteCompanyRequest$outboundSchema: z.ZodType< - DeleteCompanyRequest$Outbound, - z.ZodTypeDef, - DeleteCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function deleteCompanyRequestToJSON( - deleteCompanyRequest: DeleteCompanyRequest, -): string { - return JSON.stringify( - DeleteCompanyRequest$outboundSchema.parse(deleteCompanyRequest), - ); +export interface DeleteCompanyRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/deleteconnection.ts b/sync-for-expenses/src/sdk/models/operations/deleteconnection.ts index 83f759970..9a9aeb05b 100644 --- a/sync-for-expenses/src/sdk/models/operations/deleteconnection.ts +++ b/sync-for-expenses/src/sdk/models/operations/deleteconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type DeleteConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type DeleteConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const DeleteConnectionRequest$outboundSchema: z.ZodType< - DeleteConnectionRequest$Outbound, - z.ZodTypeDef, - DeleteConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function deleteConnectionRequestToJSON( - deleteConnectionRequest: DeleteConnectionRequest, -): string { - return JSON.stringify( - DeleteConnectionRequest$outboundSchema.parse(deleteConnectionRequest), - ); +export interface DeleteConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getcompany.ts b/sync-for-expenses/src/sdk/models/operations/getcompany.ts index 77734decc..fc2a6e4a5 100644 --- a/sync-for-expenses/src/sdk/models/operations/getcompany.ts +++ b/sync-for-expenses/src/sdk/models/operations/getcompany.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyRequest$outboundSchema: z.ZodType< - GetCompanyRequest$Outbound, - z.ZodTypeDef, - GetCompanyRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyRequestToJSON( - getCompanyRequest: GetCompanyRequest, -): string { - return JSON.stringify( - GetCompanyRequest$outboundSchema.parse(getCompanyRequest), - ); +export interface GetCompanyRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getcompanyconfiguration.ts b/sync-for-expenses/src/sdk/models/operations/getcompanyconfiguration.ts index 92ae8a498..645f24dd3 100644 --- a/sync-for-expenses/src/sdk/models/operations/getcompanyconfiguration.ts +++ b/sync-for-expenses/src/sdk/models/operations/getcompanyconfiguration.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyConfigurationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyConfigurationRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyConfigurationRequest$outboundSchema: z.ZodType< - GetCompanyConfigurationRequest$Outbound, - z.ZodTypeDef, - GetCompanyConfigurationRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyConfigurationRequestToJSON( - getCompanyConfigurationRequest: GetCompanyConfigurationRequest, -): string { - return JSON.stringify( - GetCompanyConfigurationRequest$outboundSchema.parse( - getCompanyConfigurationRequest, - ), - ); +export interface GetCompanyConfigurationRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getcompanyinfo.ts b/sync-for-expenses/src/sdk/models/operations/getcompanyinfo.ts index b3eb61f13..484f64e03 100644 --- a/sync-for-expenses/src/sdk/models/operations/getcompanyinfo.ts +++ b/sync-for-expenses/src/sdk/models/operations/getcompanyinfo.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCompanyInfoRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetCompanyInfoRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetCompanyInfoRequest$outboundSchema: z.ZodType< - GetCompanyInfoRequest$Outbound, - z.ZodTypeDef, - GetCompanyInfoRequest -> = z.object({ - companyId: z.string(), -}); - -export function getCompanyInfoRequestToJSON( - getCompanyInfoRequest: GetCompanyInfoRequest, -): string { - return JSON.stringify( - GetCompanyInfoRequest$outboundSchema.parse(getCompanyInfoRequest), - ); +export interface GetCompanyInfoRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getconnection.ts b/sync-for-expenses/src/sdk/models/operations/getconnection.ts index 126d23b85..0c787e45b 100644 --- a/sync-for-expenses/src/sdk/models/operations/getconnection.ts +++ b/sync-for-expenses/src/sdk/models/operations/getconnection.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetConnectionRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetConnectionRequest$outboundSchema: z.ZodType< - GetConnectionRequest$Outbound, - z.ZodTypeDef, - GetConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getConnectionRequestToJSON( - getConnectionRequest: GetConnectionRequest, -): string { - return JSON.stringify( - GetConnectionRequest$outboundSchema.parse(getConnectionRequest), - ); +export interface GetConnectionRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getcreatebankaccountsmodel.ts b/sync-for-expenses/src/sdk/models/operations/getcreatebankaccountsmodel.ts index 455e4e838..ca5d8221c 100644 --- a/sync-for-expenses/src/sdk/models/operations/getcreatebankaccountsmodel.ts +++ b/sync-for-expenses/src/sdk/models/operations/getcreatebankaccountsmodel.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCreateBankAccountsModelRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetCreateBankAccountsModelRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetCreateBankAccountsModelRequest$outboundSchema: z.ZodType< - GetCreateBankAccountsModelRequest$Outbound, - z.ZodTypeDef, - GetCreateBankAccountsModelRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getCreateBankAccountsModelRequestToJSON( - getCreateBankAccountsModelRequest: GetCreateBankAccountsModelRequest, -): string { - return JSON.stringify( - GetCreateBankAccountsModelRequest$outboundSchema.parse( - getCreateBankAccountsModelRequest, - ), - ); +export interface GetCreateBankAccountsModelRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getcreatechartofaccountsmodel.ts b/sync-for-expenses/src/sdk/models/operations/getcreatechartofaccountsmodel.ts index d3b2a28a6..96d055c6c 100644 --- a/sync-for-expenses/src/sdk/models/operations/getcreatechartofaccountsmodel.ts +++ b/sync-for-expenses/src/sdk/models/operations/getcreatechartofaccountsmodel.ts @@ -1,42 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCreateChartOfAccountsModelRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; -}; - -/** @internal */ -export type GetCreateChartOfAccountsModelRequest$Outbound = { - companyId: string; - connectionId: string; -}; - -/** @internal */ -export const GetCreateChartOfAccountsModelRequest$outboundSchema: z.ZodType< - GetCreateChartOfAccountsModelRequest$Outbound, - z.ZodTypeDef, - GetCreateChartOfAccountsModelRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), -}); - -export function getCreateChartOfAccountsModelRequestToJSON( - getCreateChartOfAccountsModelRequest: GetCreateChartOfAccountsModelRequest, -): string { - return JSON.stringify( - GetCreateChartOfAccountsModelRequest$outboundSchema.parse( - getCreateChartOfAccountsModelRequest, - ), - ); +export interface GetCreateChartOfAccountsModelRequest { + companyId: string; + connectionId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getcustomer.ts b/sync-for-expenses/src/sdk/models/operations/getcustomer.ts index 81a814931..ea6005e9c 100644 --- a/sync-for-expenses/src/sdk/models/operations/getcustomer.ts +++ b/sync-for-expenses/src/sdk/models/operations/getcustomer.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetCustomerRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a customer. - */ - customerId: string; -}; - -/** @internal */ -export type GetCustomerRequest$Outbound = { - companyId: string; - customerId: string; -}; - -/** @internal */ -export const GetCustomerRequest$outboundSchema: z.ZodType< - GetCustomerRequest$Outbound, - z.ZodTypeDef, - GetCustomerRequest -> = z.object({ - companyId: z.string(), - customerId: z.string(), -}); - -export function getCustomerRequestToJSON( - getCustomerRequest: GetCustomerRequest, -): string { - return JSON.stringify( - GetCustomerRequest$outboundSchema.parse(getCustomerRequest), - ); +export interface GetCustomerRequest { + companyId: string; + customerId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getdatastatus.ts b/sync-for-expenses/src/sdk/models/operations/getdatastatus.ts index e53d4c2a1..5803b76c8 100644 --- a/sync-for-expenses/src/sdk/models/operations/getdatastatus.ts +++ b/sync-for-expenses/src/sdk/models/operations/getdatastatus.ts @@ -1,296 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import * as shared from "../shared/index.js"; - -export type GetDataStatusRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** - * OK - */ -export type GetDataStatusDataStatuses = { - /** - * Describes the state of data in the Codat cache for a company and data type - */ - accountTransactions?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - balanceSheet?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankAccounts?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankTransactions?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - billCreditNotes?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - billPayments?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bills?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - cashFlowStatement?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - chartOfAccounts?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - company?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - creditNotes?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - customers?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - directCosts?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - directIncomes?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - invoices?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - itemReceipts?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - items?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - journalEntries?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - journals?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - paymentMethods?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - payments?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - profitAndLoss?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - purchaseOrders?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - salesOrders?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - suppliers?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - taxRates?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - trackingCategories?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - transfers?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingAccountBalances?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingAccounts?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingTransactionCategories?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - bankingTransactions?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceCompanyInfo?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceCustomers?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceDisputes?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceLocations?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceOrders?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commercePaymentMethods?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commercePayments?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceProductCategories?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceProducts?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceTaxComponents?: shared.DataStatus | undefined; - /** - * Describes the state of data in the Codat cache for a company and data type - */ - commerceTransactions?: shared.DataStatus | undefined; -}; - -/** @internal */ -export type GetDataStatusRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetDataStatusRequest$outboundSchema: z.ZodType< - GetDataStatusRequest$Outbound, - z.ZodTypeDef, - GetDataStatusRequest -> = z.object({ - companyId: z.string(), -}); - -export function getDataStatusRequestToJSON( - getDataStatusRequest: GetDataStatusRequest, -): string { - return JSON.stringify( - GetDataStatusRequest$outboundSchema.parse(getDataStatusRequest), - ); -} - -/** @internal */ -export const GetDataStatusDataStatuses$inboundSchema: z.ZodType< - GetDataStatusDataStatuses, - z.ZodTypeDef, - unknown -> = z.object({ - accountTransactions: shared.DataStatus$inboundSchema.optional(), - balanceSheet: shared.DataStatus$inboundSchema.optional(), - bankAccounts: shared.DataStatus$inboundSchema.optional(), - bankTransactions: shared.DataStatus$inboundSchema.optional(), - billCreditNotes: shared.DataStatus$inboundSchema.optional(), - billPayments: shared.DataStatus$inboundSchema.optional(), - bills: shared.DataStatus$inboundSchema.optional(), - cashFlowStatement: shared.DataStatus$inboundSchema.optional(), - chartOfAccounts: shared.DataStatus$inboundSchema.optional(), - company: shared.DataStatus$inboundSchema.optional(), - creditNotes: shared.DataStatus$inboundSchema.optional(), - customers: shared.DataStatus$inboundSchema.optional(), - directCosts: shared.DataStatus$inboundSchema.optional(), - directIncomes: shared.DataStatus$inboundSchema.optional(), - invoices: shared.DataStatus$inboundSchema.optional(), - itemReceipts: shared.DataStatus$inboundSchema.optional(), - items: shared.DataStatus$inboundSchema.optional(), - journalEntries: shared.DataStatus$inboundSchema.optional(), - journals: shared.DataStatus$inboundSchema.optional(), - paymentMethods: shared.DataStatus$inboundSchema.optional(), - payments: shared.DataStatus$inboundSchema.optional(), - profitAndLoss: shared.DataStatus$inboundSchema.optional(), - purchaseOrders: shared.DataStatus$inboundSchema.optional(), - salesOrders: shared.DataStatus$inboundSchema.optional(), - suppliers: shared.DataStatus$inboundSchema.optional(), - taxRates: shared.DataStatus$inboundSchema.optional(), - trackingCategories: shared.DataStatus$inboundSchema.optional(), - transfers: shared.DataStatus$inboundSchema.optional(), - "banking-accountBalances": shared.DataStatus$inboundSchema.optional(), - "banking-accounts": shared.DataStatus$inboundSchema.optional(), - "banking-transactionCategories": shared.DataStatus$inboundSchema.optional(), - "banking-transactions": shared.DataStatus$inboundSchema.optional(), - "commerce-companyInfo": shared.DataStatus$inboundSchema.optional(), - "commerce-customers": shared.DataStatus$inboundSchema.optional(), - "commerce-disputes": shared.DataStatus$inboundSchema.optional(), - "commerce-locations": shared.DataStatus$inboundSchema.optional(), - "commerce-orders": shared.DataStatus$inboundSchema.optional(), - "commerce-paymentMethods": shared.DataStatus$inboundSchema.optional(), - "commerce-payments": shared.DataStatus$inboundSchema.optional(), - "commerce-productCategories": shared.DataStatus$inboundSchema.optional(), - "commerce-products": shared.DataStatus$inboundSchema.optional(), - "commerce-taxComponents": shared.DataStatus$inboundSchema.optional(), - "commerce-transactions": shared.DataStatus$inboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - "banking-accountBalances": "bankingAccountBalances", - "banking-accounts": "bankingAccounts", - "banking-transactionCategories": "bankingTransactionCategories", - "banking-transactions": "bankingTransactions", - "commerce-companyInfo": "commerceCompanyInfo", - "commerce-customers": "commerceCustomers", - "commerce-disputes": "commerceDisputes", - "commerce-locations": "commerceLocations", - "commerce-orders": "commerceOrders", - "commerce-paymentMethods": "commercePaymentMethods", - "commerce-payments": "commercePayments", - "commerce-productCategories": "commerceProductCategories", - "commerce-products": "commerceProducts", - "commerce-taxComponents": "commerceTaxComponents", - "commerce-transactions": "commerceTransactions", - }); -}); - -export function getDataStatusDataStatusesFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => GetDataStatusDataStatuses$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'GetDataStatusDataStatuses' from JSON`, - ); +export interface GetDataStatusRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getlastsuccessfulsync.ts b/sync-for-expenses/src/sdk/models/operations/getlastsuccessfulsync.ts index f34d49fb6..3f6de28f7 100644 --- a/sync-for-expenses/src/sdk/models/operations/getlastsuccessfulsync.ts +++ b/sync-for-expenses/src/sdk/models/operations/getlastsuccessfulsync.ts @@ -1,36 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetLastSuccessfulSyncRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetLastSuccessfulSyncRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetLastSuccessfulSyncRequest$outboundSchema: z.ZodType< - GetLastSuccessfulSyncRequest$Outbound, - z.ZodTypeDef, - GetLastSuccessfulSyncRequest -> = z.object({ - companyId: z.string(), -}); - -export function getLastSuccessfulSyncRequestToJSON( - getLastSuccessfulSyncRequest: GetLastSuccessfulSyncRequest, -): string { - return JSON.stringify( - GetLastSuccessfulSyncRequest$outboundSchema.parse( - getLastSuccessfulSyncRequest, - ), - ); +export interface GetLastSuccessfulSyncRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getlatestsync.ts b/sync-for-expenses/src/sdk/models/operations/getlatestsync.ts index 79ec54e8f..39c2de448 100644 --- a/sync-for-expenses/src/sdk/models/operations/getlatestsync.ts +++ b/sync-for-expenses/src/sdk/models/operations/getlatestsync.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetLatestSyncRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetLatestSyncRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetLatestSyncRequest$outboundSchema: z.ZodType< - GetLatestSyncRequest$Outbound, - z.ZodTypeDef, - GetLatestSyncRequest -> = z.object({ - companyId: z.string(), -}); - -export function getLatestSyncRequestToJSON( - getLatestSyncRequest: GetLatestSyncRequest, -): string { - return JSON.stringify( - GetLatestSyncRequest$outboundSchema.parse(getLatestSyncRequest), - ); +export interface GetLatestSyncRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getmappingoptions.ts b/sync-for-expenses/src/sdk/models/operations/getmappingoptions.ts index 8a198d5ad..979e31c51 100644 --- a/sync-for-expenses/src/sdk/models/operations/getmappingoptions.ts +++ b/sync-for-expenses/src/sdk/models/operations/getmappingoptions.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetMappingOptionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type GetMappingOptionsRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const GetMappingOptionsRequest$outboundSchema: z.ZodType< - GetMappingOptionsRequest$Outbound, - z.ZodTypeDef, - GetMappingOptionsRequest -> = z.object({ - companyId: z.string(), -}); - -export function getMappingOptionsRequestToJSON( - getMappingOptionsRequest: GetMappingOptionsRequest, -): string { - return JSON.stringify( - GetMappingOptionsRequest$outboundSchema.parse(getMappingOptionsRequest), - ); +export interface GetMappingOptionsRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getpulloperation.ts b/sync-for-expenses/src/sdk/models/operations/getpulloperation.ts index 2df9079da..3eda7bf20 100644 --- a/sync-for-expenses/src/sdk/models/operations/getpulloperation.ts +++ b/sync-for-expenses/src/sdk/models/operations/getpulloperation.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetPullOperationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for the dataset that completed its sync. - */ - datasetId: string; -}; - -/** @internal */ -export type GetPullOperationRequest$Outbound = { - companyId: string; - datasetId: string; -}; - -/** @internal */ -export const GetPullOperationRequest$outboundSchema: z.ZodType< - GetPullOperationRequest$Outbound, - z.ZodTypeDef, - GetPullOperationRequest -> = z.object({ - companyId: z.string(), - datasetId: z.string(), -}); - -export function getPullOperationRequestToJSON( - getPullOperationRequest: GetPullOperationRequest, -): string { - return JSON.stringify( - GetPullOperationRequest$outboundSchema.parse(getPullOperationRequest), - ); +export interface GetPullOperationRequest { + companyId: string; + datasetId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getpushoperation.ts b/sync-for-expenses/src/sdk/models/operations/getpushoperation.ts index 3a950624c..bb3d4ada9 100644 --- a/sync-for-expenses/src/sdk/models/operations/getpushoperation.ts +++ b/sync-for-expenses/src/sdk/models/operations/getpushoperation.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetPushOperationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Push operation key. - */ - pushOperationKey: string; -}; - -/** @internal */ -export type GetPushOperationRequest$Outbound = { - companyId: string; - pushOperationKey: string; -}; - -/** @internal */ -export const GetPushOperationRequest$outboundSchema: z.ZodType< - GetPushOperationRequest$Outbound, - z.ZodTypeDef, - GetPushOperationRequest -> = z.object({ - companyId: z.string(), - pushOperationKey: z.string(), -}); - -export function getPushOperationRequestToJSON( - getPushOperationRequest: GetPushOperationRequest, -): string { - return JSON.stringify( - GetPushOperationRequest$outboundSchema.parse(getPushOperationRequest), - ); +export interface GetPushOperationRequest { + companyId: string; + pushOperationKey: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getsupplier.ts b/sync-for-expenses/src/sdk/models/operations/getsupplier.ts index 6b849a6cd..5bc06ee5c 100644 --- a/sync-for-expenses/src/sdk/models/operations/getsupplier.ts +++ b/sync-for-expenses/src/sdk/models/operations/getsupplier.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetSupplierRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a supplier. - */ - supplierId: string; -}; - -/** @internal */ -export type GetSupplierRequest$Outbound = { - companyId: string; - supplierId: string; -}; - -/** @internal */ -export const GetSupplierRequest$outboundSchema: z.ZodType< - GetSupplierRequest$Outbound, - z.ZodTypeDef, - GetSupplierRequest -> = z.object({ - companyId: z.string(), - supplierId: z.string(), -}); - -export function getSupplierRequestToJSON( - getSupplierRequest: GetSupplierRequest, -): string { - return JSON.stringify( - GetSupplierRequest$outboundSchema.parse(getSupplierRequest), - ); +export interface GetSupplierRequest { + companyId: string; + supplierId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getsyncbyid.ts b/sync-for-expenses/src/sdk/models/operations/getsyncbyid.ts index 9b31d1939..5213dca67 100644 --- a/sync-for-expenses/src/sdk/models/operations/getsyncbyid.ts +++ b/sync-for-expenses/src/sdk/models/operations/getsyncbyid.ts @@ -1,40 +1,7 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetSyncByIdRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a sync. - */ - syncId: string; -}; - -/** @internal */ -export type GetSyncByIdRequest$Outbound = { - companyId: string; - syncId: string; -}; - -/** @internal */ -export const GetSyncByIdRequest$outboundSchema: z.ZodType< - GetSyncByIdRequest$Outbound, - z.ZodTypeDef, - GetSyncByIdRequest -> = z.object({ - companyId: z.string(), - syncId: z.string(), -}); - -export function getSyncByIdRequestToJSON( - getSyncByIdRequest: GetSyncByIdRequest, -): string { - return JSON.stringify( - GetSyncByIdRequest$outboundSchema.parse(getSyncByIdRequest), - ); +export interface GetSyncByIdRequest { + companyId: string; + syncId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/getsynctransaction.ts b/sync-for-expenses/src/sdk/models/operations/getsynctransaction.ts index 0f6f9b131..afa68c02f 100644 --- a/sync-for-expenses/src/sdk/models/operations/getsynctransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/getsynctransaction.ts @@ -1,46 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type GetSyncTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a sync. - */ - syncId: string; - /** - * The unique identifier for your SMB's transaction. - */ - transactionId: string; -}; - -/** @internal */ -export type GetSyncTransactionRequest$Outbound = { - companyId: string; - syncId: string; - transactionId: string; -}; - -/** @internal */ -export const GetSyncTransactionRequest$outboundSchema: z.ZodType< - GetSyncTransactionRequest$Outbound, - z.ZodTypeDef, - GetSyncTransactionRequest -> = z.object({ - companyId: z.string(), - syncId: z.string(), - transactionId: z.string(), -}); - -export function getSyncTransactionRequestToJSON( - getSyncTransactionRequest: GetSyncTransactionRequest, -): string { - return JSON.stringify( - GetSyncTransactionRequest$outboundSchema.parse(getSyncTransactionRequest), - ); +export interface GetSyncTransactionRequest { + companyId: string; + syncId: string; + transactionId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/index.ts b/sync-for-expenses/src/sdk/models/operations/index.ts index 41dbedfe6..9e0f6dcea 100644 --- a/sync-for-expenses/src/sdk/models/operations/index.ts +++ b/sync-for-expenses/src/sdk/models/operations/index.ts @@ -1,51 +1,53 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./createaccount.js"; -export * from "./createadjustmenttransaction.js"; -export * from "./createbankaccount.js"; -export * from "./createconnection.js"; -export * from "./createcustomer.js"; -export * from "./createexpensetransaction.js"; -export * from "./createpartnerexpenseconnection.js"; -export * from "./createreimbursableexpensetransaction.js"; -export * from "./createsupplier.js"; -export * from "./createtransfertransaction.js"; -export * from "./deletecompany.js"; -export * from "./deleteconnection.js"; -export * from "./getcompany.js"; -export * from "./getcompanyconfiguration.js"; -export * from "./getcompanyinfo.js"; -export * from "./getconnection.js"; -export * from "./getcreatebankaccountsmodel.js"; -export * from "./getcreatechartofaccountsmodel.js"; -export * from "./getcustomer.js"; -export * from "./getdatastatus.js"; -export * from "./getlastsuccessfulsync.js"; -export * from "./getlatestsync.js"; -export * from "./getmappingoptions.js"; -export * from "./getpulloperation.js"; -export * from "./getpushoperation.js"; -export * from "./getsupplier.js"; -export * from "./getsyncbyid.js"; -export * from "./getsynctransaction.js"; -export * from "./listcompanies.js"; -export * from "./listconnections.js"; -export * from "./listcustomers.js"; -export * from "./listpulloperations.js"; -export * from "./listpushoperations.js"; -export * from "./listsuppliers.js"; -export * from "./listsyncs.js"; -export * from "./listsynctransactions.js"; -export * from "./refreshalldatatypes.js"; -export * from "./refreshdatatype.js"; -export * from "./replacecompany.js"; -export * from "./setcompanyconfiguration.js"; -export * from "./unlinkconnection.js"; -export * from "./updatecompany.js"; -export * from "./updatecustomer.js"; -export * from "./updateexpensetransaction.js"; -export * from "./updatereimbursableexpensetransaction.js"; -export * from "./updatesupplier.js"; -export * from "./uploadexpenseattachment.js"; +export * from './createaccount'; +export * from './createadjustmenttransaction'; +export * from './createbankaccount'; +export * from './createconnection'; +export * from './createconnectionrequestbody'; +export * from './createcustomer'; +export * from './createexpensetransaction'; +export * from './createpartnerexpenseconnection'; +export * from './createreimbursableexpensetransaction'; +export * from './createsupplier'; +export * from './createtransfertransaction'; +export * from './deletecompany'; +export * from './deleteconnection'; +export * from './getcompanyconfiguration'; +export * from './getcompanyinfo'; +export * from './getcompany'; +export * from './getconnection'; +export * from './getcreatebankaccountsmodel'; +export * from './getcreatechartofaccountsmodel'; +export * from './getcustomer'; +export * from './getdatastatus'; +export * from './getlastsuccessfulsync'; +export * from './getlatestsync'; +export * from './getmappingoptions'; +export * from './getpulloperation'; +export * from './getpushoperation'; +export * from './getsupplier'; +export * from './getsyncbyid'; +export * from './getsynctransaction'; +export * from './listcompanies'; +export * from './listconnections'; +export * from './listcustomers'; +export * from './listpulloperations'; +export * from './listpushoperations'; +export * from './listsuppliers'; +export * from './listsynctransactions'; +export * from './listsyncs'; +export * from './refreshalldatatypes'; +export * from './refreshdatatype'; +export * from './replacecompany'; +export * from './setcompanyconfiguration'; +export * from './unlinkconnection'; +export * from './updatecompany'; +export * from './updatecustomer'; +export * from './updateexpensetransaction'; +export * from './updatereimbursableexpensetransaction'; +export * from './updatesupplier'; +export * from './uploadexpenseattachment'; +export { GetDataStatusDataStatuses } from '../DataStatuses'; +export { UnlinkConnectionUpdateConnection } from '../UpdateConnection'; diff --git a/sync-for-expenses/src/sdk/models/operations/listcompanies.ts b/sync-for-expenses/src/sdk/models/operations/listcompanies.ts index 837a6aae5..939f42b3f 100644 --- a/sync-for-expenses/src/sdk/models/operations/listcompanies.ts +++ b/sync-for-expenses/src/sdk/models/operations/listcompanies.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCompaniesRequest = { - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; - /** - * Filter companies by tags using the "equals" (=), "not equals" (!=), and "contains" (~) operators with [Codat’s query language](https://docs.codat.io/using-the-api/querying). - */ - tags?: string | undefined; -}; - -/** @internal */ -export type ListCompaniesRequest$Outbound = { - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; - tags?: string | undefined; -}; - -/** @internal */ -export const ListCompaniesRequest$outboundSchema: z.ZodType< - ListCompaniesRequest$Outbound, - z.ZodTypeDef, - ListCompaniesRequest -> = z.object({ - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), - tags: z.string().optional(), -}); - -export function listCompaniesRequestToJSON( - listCompaniesRequest: ListCompaniesRequest, -): string { - return JSON.stringify( - ListCompaniesRequest$outboundSchema.parse(listCompaniesRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCompaniesRequest { + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; + tags?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listconnections.ts b/sync-for-expenses/src/sdk/models/operations/listconnections.ts index d1be0d942..47d6ac043 100644 --- a/sync-for-expenses/src/sdk/models/operations/listconnections.ts +++ b/sync-for-expenses/src/sdk/models/operations/listconnections.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListConnectionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListConnectionsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListConnectionsRequest$outboundSchema: z.ZodType< - ListConnectionsRequest$Outbound, - z.ZodTypeDef, - ListConnectionsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listConnectionsRequestToJSON( - listConnectionsRequest: ListConnectionsRequest, -): string { - return JSON.stringify( - ListConnectionsRequest$outboundSchema.parse(listConnectionsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListConnectionsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listcustomers.ts b/sync-for-expenses/src/sdk/models/operations/listcustomers.ts index df64364b9..ac4adf1c2 100644 --- a/sync-for-expenses/src/sdk/models/operations/listcustomers.ts +++ b/sync-for-expenses/src/sdk/models/operations/listcustomers.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListCustomersRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListCustomersRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListCustomersRequest$outboundSchema: z.ZodType< - ListCustomersRequest$Outbound, - z.ZodTypeDef, - ListCustomersRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listCustomersRequestToJSON( - listCustomersRequest: ListCustomersRequest, -): string { - return JSON.stringify( - ListCustomersRequest$outboundSchema.parse(listCustomersRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListCustomersRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listpulloperations.ts b/sync-for-expenses/src/sdk/models/operations/listpulloperations.ts index d12f7bd86..e29c613bf 100644 --- a/sync-for-expenses/src/sdk/models/operations/listpulloperations.ts +++ b/sync-for-expenses/src/sdk/models/operations/listpulloperations.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListPullOperationsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListPullOperationsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListPullOperationsRequest$outboundSchema: z.ZodType< - ListPullOperationsRequest$Outbound, - z.ZodTypeDef, - ListPullOperationsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listPullOperationsRequestToJSON( - listPullOperationsRequest: ListPullOperationsRequest, -): string { - return JSON.stringify( - ListPullOperationsRequest$outboundSchema.parse(listPullOperationsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListPullOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listpushoperations.ts b/sync-for-expenses/src/sdk/models/operations/listpushoperations.ts index f46177956..ab7866dde 100644 --- a/sync-for-expenses/src/sdk/models/operations/listpushoperations.ts +++ b/sync-for-expenses/src/sdk/models/operations/listpushoperations.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListPushOperationsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListPushOperationsRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListPushOperationsRequest$outboundSchema: z.ZodType< - ListPushOperationsRequest$Outbound, - z.ZodTypeDef, - ListPushOperationsRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listPushOperationsRequestToJSON( - listPushOperationsRequest: ListPushOperationsRequest, -): string { - return JSON.stringify( - ListPushOperationsRequest$outboundSchema.parse(listPushOperationsRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListPushOperationsRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listsuppliers.ts b/sync-for-expenses/src/sdk/models/operations/listsuppliers.ts index 0b72b9ddc..ceaf14aad 100644 --- a/sync-for-expenses/src/sdk/models/operations/listsuppliers.ts +++ b/sync-for-expenses/src/sdk/models/operations/listsuppliers.ts @@ -1,58 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListSuppliersRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; - /** - * Codat query string. [Read more](https://docs.codat.io/using-the-api/querying). - */ - query?: string | undefined; - /** - * Field to order results by. [Read more](https://docs.codat.io/using-the-api/ordering-results). - */ - orderBy?: string | undefined; -}; - -/** @internal */ -export type ListSuppliersRequest$Outbound = { - companyId: string; - page: number; - pageSize: number; - query?: string | undefined; - orderBy?: string | undefined; -}; - -/** @internal */ -export const ListSuppliersRequest$outboundSchema: z.ZodType< - ListSuppliersRequest$Outbound, - z.ZodTypeDef, - ListSuppliersRequest -> = z.object({ - companyId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), - query: z.string().optional(), - orderBy: z.string().optional(), -}); - -export function listSuppliersRequestToJSON( - listSuppliersRequest: ListSuppliersRequest, -): string { - return JSON.stringify( - ListSuppliersRequest$outboundSchema.parse(listSuppliersRequest), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListSuppliersRequest { + companyId: string; + page?: number; + pageSize?: number; + query?: string; + orderBy?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listsyncs.ts b/sync-for-expenses/src/sdk/models/operations/listsyncs.ts index 0fd0f5150..10b91c07c 100644 --- a/sync-for-expenses/src/sdk/models/operations/listsyncs.ts +++ b/sync-for-expenses/src/sdk/models/operations/listsyncs.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type ListSyncsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type ListSyncsRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const ListSyncsRequest$outboundSchema: z.ZodType< - ListSyncsRequest$Outbound, - z.ZodTypeDef, - ListSyncsRequest -> = z.object({ - companyId: z.string(), -}); - -export function listSyncsRequestToJSON( - listSyncsRequest: ListSyncsRequest, -): string { - return JSON.stringify( - ListSyncsRequest$outboundSchema.parse(listSyncsRequest), - ); +export interface ListSyncsRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/listsynctransactions.ts b/sync-for-expenses/src/sdk/models/operations/listsynctransactions.ts index 1023458ab..d1ec97108 100644 --- a/sync-for-expenses/src/sdk/models/operations/listsynctransactions.ts +++ b/sync-for-expenses/src/sdk/models/operations/listsynctransactions.ts @@ -1,54 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export type ListSyncTransactionsRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a sync. - */ - syncId: string; - /** - * Page number. [Read more](https://docs.codat.io/using-the-api/paging). - */ - page?: number | undefined; - /** - * Number of records to return in a page. [Read more](https://docs.codat.io/using-the-api/paging). - */ - pageSize?: number | undefined; -}; - -/** @internal */ -export type ListSyncTransactionsRequest$Outbound = { - companyId: string; - syncId: string; - page: number; - pageSize: number; -}; - -/** @internal */ -export const ListSyncTransactionsRequest$outboundSchema: z.ZodType< - ListSyncTransactionsRequest$Outbound, - z.ZodTypeDef, - ListSyncTransactionsRequest -> = z.object({ - companyId: z.string(), - syncId: z.string(), - page: z.number().int().default(1), - pageSize: z.number().int().default(100), -}); - -export function listSyncTransactionsRequestToJSON( - listSyncTransactionsRequest: ListSyncTransactionsRequest, -): string { - return JSON.stringify( - ListSyncTransactionsRequest$outboundSchema.parse( - listSyncTransactionsRequest, - ), - ); +/* tslint:disable */ +/* eslint-disable */ + +export interface ListSyncTransactionsRequest { + companyId: string; + syncId: string; + page?: number; + pageSize?: number; } diff --git a/sync-for-expenses/src/sdk/models/operations/refreshalldatatypes.ts b/sync-for-expenses/src/sdk/models/operations/refreshalldatatypes.ts index de184ca9a..7a4934589 100644 --- a/sync-for-expenses/src/sdk/models/operations/refreshalldatatypes.ts +++ b/sync-for-expenses/src/sdk/models/operations/refreshalldatatypes.ts @@ -1,34 +1,6 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; - -export type RefreshAllDataTypesRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; -}; - -/** @internal */ -export type RefreshAllDataTypesRequest$Outbound = { - companyId: string; -}; - -/** @internal */ -export const RefreshAllDataTypesRequest$outboundSchema: z.ZodType< - RefreshAllDataTypesRequest$Outbound, - z.ZodTypeDef, - RefreshAllDataTypesRequest -> = z.object({ - companyId: z.string(), -}); - -export function refreshAllDataTypesRequestToJSON( - refreshAllDataTypesRequest: RefreshAllDataTypesRequest, -): string { - return JSON.stringify( - RefreshAllDataTypesRequest$outboundSchema.parse(refreshAllDataTypesRequest), - ); +export interface RefreshAllDataTypesRequest { + companyId: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/refreshdatatype.ts b/sync-for-expenses/src/sdk/models/operations/refreshdatatype.ts index 6b357ce88..5bb731207 100644 --- a/sync-for-expenses/src/sdk/models/operations/refreshdatatype.ts +++ b/sync-for-expenses/src/sdk/models/operations/refreshdatatype.ts @@ -1,47 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import * as shared from "../shared/index.js"; +import type { DataType } from '../shared/datatype'; +/* eslint-disable */ -export type RefreshDataTypeRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * The key of a Codat data type - */ - dataType: shared.DataType; - /** - * Optionally, provide a data connection id to only queue pull operations on that connection. - */ - connectionId?: string | undefined; -}; - -/** @internal */ -export type RefreshDataTypeRequest$Outbound = { - companyId: string; - dataType: string; - connectionId?: string | undefined; -}; - -/** @internal */ -export const RefreshDataTypeRequest$outboundSchema: z.ZodType< - RefreshDataTypeRequest$Outbound, - z.ZodTypeDef, - RefreshDataTypeRequest -> = z.object({ - companyId: z.string(), - dataType: shared.DataType$outboundSchema, - connectionId: z.string().optional(), -}); - -export function refreshDataTypeRequestToJSON( - refreshDataTypeRequest: RefreshDataTypeRequest, -): string { - return JSON.stringify( - RefreshDataTypeRequest$outboundSchema.parse(refreshDataTypeRequest), - ); +export interface RefreshDataTypeRequest { + companyId: string; + dataType: DataType; + connectionId?: string; } diff --git a/sync-for-expenses/src/sdk/models/operations/replacecompany.ts b/sync-for-expenses/src/sdk/models/operations/replacecompany.ts index 5ee35551d..6add5d7c2 100644 --- a/sync-for-expenses/src/sdk/models/operations/replacecompany.ts +++ b/sync-for-expenses/src/sdk/models/operations/replacecompany.ts @@ -1,43 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyRequestBody } from '../shared/companyrequestbody'; +/* eslint-disable */ -export type ReplaceCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyRequestBody?: shared.CompanyRequestBody | undefined; -}; - -/** @internal */ -export type ReplaceCompanyRequest$Outbound = { - companyId: string; - CompanyRequestBody?: shared.CompanyRequestBody$Outbound | undefined; -}; - -/** @internal */ -export const ReplaceCompanyRequest$outboundSchema: z.ZodType< - ReplaceCompanyRequest$Outbound, - z.ZodTypeDef, - ReplaceCompanyRequest -> = z.object({ - companyId: z.string(), - companyRequestBody: shared.CompanyRequestBody$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyRequestBody: "CompanyRequestBody", - }); -}); - -export function replaceCompanyRequestToJSON( - replaceCompanyRequest: ReplaceCompanyRequest, -): string { - return JSON.stringify( - ReplaceCompanyRequest$outboundSchema.parse(replaceCompanyRequest), - ); +export interface ReplaceCompanyRequest { + companyId: string; + companyRequestBody?: CompanyRequestBody | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/setcompanyconfiguration.ts b/sync-for-expenses/src/sdk/models/operations/setcompanyconfiguration.ts index 6040c8b7c..a89d0ca50 100644 --- a/sync-for-expenses/src/sdk/models/operations/setcompanyconfiguration.ts +++ b/sync-for-expenses/src/sdk/models/operations/setcompanyconfiguration.ts @@ -1,45 +1,9 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyConfiguration } from '../shared/companyconfiguration'; +/* eslint-disable */ -export type SetCompanyConfigurationRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyConfiguration?: shared.CompanyConfiguration | undefined; -}; - -/** @internal */ -export type SetCompanyConfigurationRequest$Outbound = { - companyId: string; - CompanyConfiguration?: shared.CompanyConfiguration$Outbound | undefined; -}; - -/** @internal */ -export const SetCompanyConfigurationRequest$outboundSchema: z.ZodType< - SetCompanyConfigurationRequest$Outbound, - z.ZodTypeDef, - SetCompanyConfigurationRequest -> = z.object({ - companyId: z.string(), - companyConfiguration: shared.CompanyConfiguration$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyConfiguration: "CompanyConfiguration", - }); -}); - -export function setCompanyConfigurationRequestToJSON( - setCompanyConfigurationRequest: SetCompanyConfigurationRequest, -): string { - return JSON.stringify( - SetCompanyConfigurationRequest$outboundSchema.parse( - setCompanyConfigurationRequest, - ), - ); +export interface SetCompanyConfigurationRequest { + companyId: string; + companyConfiguration?: CompanyConfiguration | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/unlinkconnection.ts b/sync-for-expenses/src/sdk/models/operations/unlinkconnection.ts index dbdba4a38..6bd02ed51 100644 --- a/sync-for-expenses/src/sdk/models/operations/unlinkconnection.ts +++ b/sync-for-expenses/src/sdk/models/operations/unlinkconnection.ts @@ -1,81 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { UnlinkConnectionUpdateConnection } from '../UpdateConnection'; +/* eslint-disable */ -export type UnlinkConnectionUpdateConnection = { - /** - * The current authorization status of the data connection. - */ - status?: shared.DataConnectionStatus | undefined; -}; - -export type UnlinkConnectionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - requestBody?: UnlinkConnectionUpdateConnection | undefined; -}; - -/** @internal */ -export type UnlinkConnectionUpdateConnection$Outbound = { - status?: string | undefined; -}; - -/** @internal */ -export const UnlinkConnectionUpdateConnection$outboundSchema: z.ZodType< - UnlinkConnectionUpdateConnection$Outbound, - z.ZodTypeDef, - UnlinkConnectionUpdateConnection -> = z.object({ - status: shared.DataConnectionStatus$outboundSchema.optional(), -}); - -export function unlinkConnectionUpdateConnectionToJSON( - unlinkConnectionUpdateConnection: UnlinkConnectionUpdateConnection, -): string { - return JSON.stringify( - UnlinkConnectionUpdateConnection$outboundSchema.parse( - unlinkConnectionUpdateConnection, - ), - ); -} - -/** @internal */ -export type UnlinkConnectionRequest$Outbound = { - companyId: string; - connectionId: string; - RequestBody?: UnlinkConnectionUpdateConnection$Outbound | undefined; -}; - -/** @internal */ -export const UnlinkConnectionRequest$outboundSchema: z.ZodType< - UnlinkConnectionRequest$Outbound, - z.ZodTypeDef, - UnlinkConnectionRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - requestBody: z.lazy(() => UnlinkConnectionUpdateConnection$outboundSchema) - .optional(), -}).transform((v) => { - return remap$(v, { - requestBody: "RequestBody", - }); -}); - -export function unlinkConnectionRequestToJSON( - unlinkConnectionRequest: UnlinkConnectionRequest, -): string { - return JSON.stringify( - UnlinkConnectionRequest$outboundSchema.parse(unlinkConnectionRequest), - ); +export interface UnlinkConnectionRequest { + companyId: string; + connectionId: string; + requestBody?: UnlinkConnectionUpdateConnection; } diff --git a/sync-for-expenses/src/sdk/models/operations/updatecompany.ts b/sync-for-expenses/src/sdk/models/operations/updatecompany.ts index 37ead4428..618928d50 100644 --- a/sync-for-expenses/src/sdk/models/operations/updatecompany.ts +++ b/sync-for-expenses/src/sdk/models/operations/updatecompany.ts @@ -1,43 +1,14 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { CompanyUpdateRequest } from '../shared/companyupdaterequest'; +/* eslint-disable */ -export type UpdateCompanyRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - companyUpdateRequest?: shared.CompanyUpdateRequest | undefined; -}; - -/** @internal */ -export type UpdateCompanyRequest$Outbound = { - companyId: string; - CompanyUpdateRequest?: shared.CompanyUpdateRequest$Outbound | undefined; -}; - -/** @internal */ -export const UpdateCompanyRequest$outboundSchema: z.ZodType< - UpdateCompanyRequest$Outbound, - z.ZodTypeDef, - UpdateCompanyRequest -> = z.object({ - companyId: z.string(), - companyUpdateRequest: shared.CompanyUpdateRequest$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - companyUpdateRequest: "CompanyUpdateRequest", - }); -}); +export interface UpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; +} -export function updateCompanyRequestToJSON( - updateCompanyRequest: UpdateCompanyRequest, -): string { - return JSON.stringify( - UpdateCompanyRequest$outboundSchema.parse(updateCompanyRequest), - ); +export interface CompanyUpdateRequestUpdateCompanyRequest { + companyId: string; + companyUpdateRequest?: CompanyUpdateRequest | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/updatecustomer.ts b/sync-for-expenses/src/sdk/models/operations/updatecustomer.ts index 04698340a..ac19d1c37 100644 --- a/sync-for-expenses/src/sdk/models/operations/updatecustomer.ts +++ b/sync-for-expenses/src/sdk/models/operations/updatecustomer.ts @@ -1,73 +1,14 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; - -export type UpdateCustomerRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a customer. - */ - customerId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - /** - * When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. - */ - forceUpdate?: boolean | undefined; - customer?: shared.Customer | null | undefined; -}; - -/** @internal */ -export type UpdateCustomerRequest$Outbound = { - companyId: string; - connectionId: string; - customerId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - forceUpdate: boolean; - Customer?: shared.Customer$Outbound | null | undefined; -}; - -/** @internal */ -export const UpdateCustomerRequest$outboundSchema: z.ZodType< - UpdateCustomerRequest$Outbound, - z.ZodTypeDef, - UpdateCustomerRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - customerId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - forceUpdate: z.boolean().default(false), - customer: z.nullable(shared.Customer$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - customer: "Customer", - }); -}); - -export function updateCustomerRequestToJSON( - updateCustomerRequest: UpdateCustomerRequest, -): string { - return JSON.stringify( - UpdateCustomerRequest$outboundSchema.parse(updateCustomerRequest), - ); +/* tslint:disable */ + +import type { Customer } from '../shared/customer'; +/* eslint-disable */ + +export interface UpdateCustomerRequest { + companyId: string; + connectionId: string; + customerId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + forceUpdate?: boolean; + customer?: Customer | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/updateexpensetransaction.ts b/sync-for-expenses/src/sdk/models/operations/updateexpensetransaction.ts index 4e1347a02..99fc421b1 100644 --- a/sync-for-expenses/src/sdk/models/operations/updateexpensetransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/updateexpensetransaction.ts @@ -1,51 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { UpdateExpenseRequest } from '../shared/updateexpenserequest'; +/* eslint-disable */ -export type UpdateExpenseTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * The unique identifier for your SMB's transaction. - */ - transactionId: string; - updateExpenseRequest?: shared.UpdateExpenseRequest | undefined; -}; - -/** @internal */ -export type UpdateExpenseTransactionRequest$Outbound = { - companyId: string; - transactionId: string; - UpdateExpenseRequest?: shared.UpdateExpenseRequest$Outbound | undefined; -}; - -/** @internal */ -export const UpdateExpenseTransactionRequest$outboundSchema: z.ZodType< - UpdateExpenseTransactionRequest$Outbound, - z.ZodTypeDef, - UpdateExpenseTransactionRequest -> = z.object({ - companyId: z.string(), - transactionId: z.string(), - updateExpenseRequest: shared.UpdateExpenseRequest$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - updateExpenseRequest: "UpdateExpenseRequest", - }); -}); - -export function updateExpenseTransactionRequestToJSON( - updateExpenseTransactionRequest: UpdateExpenseTransactionRequest, -): string { - return JSON.stringify( - UpdateExpenseTransactionRequest$outboundSchema.parse( - updateExpenseTransactionRequest, - ), - ); +export interface UpdateExpenseTransactionRequest { + companyId: string; + transactionId: string; + updateExpenseRequest?: UpdateExpenseRequest | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/updatereimbursableexpensetransaction.ts b/sync-for-expenses/src/sdk/models/operations/updatereimbursableexpensetransaction.ts index 39e89ab2a..9744a05b8 100644 --- a/sync-for-expenses/src/sdk/models/operations/updatereimbursableexpensetransaction.ts +++ b/sync-for-expenses/src/sdk/models/operations/updatereimbursableexpensetransaction.ts @@ -1,59 +1,10 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import * as shared from '../shared'; -export type UpdateReimbursableExpenseTransactionRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * The unique identifier for your SMB's transaction. - */ - transactionId: string; - updateReimbursableExpenseTransactionRequest?: - | shared.UpdateReimbursableExpenseTransactionRequest - | undefined; -}; - -/** @internal */ -export type UpdateReimbursableExpenseTransactionRequest$Outbound = { - companyId: string; - transactionId: string; - UpdateReimbursableExpenseTransactionRequest?: - | shared.UpdateReimbursableExpenseTransactionRequest$Outbound - | undefined; -}; - -/** @internal */ -export const UpdateReimbursableExpenseTransactionRequest$outboundSchema: - z.ZodType< - UpdateReimbursableExpenseTransactionRequest$Outbound, - z.ZodTypeDef, - UpdateReimbursableExpenseTransactionRequest - > = z.object({ - companyId: z.string(), - transactionId: z.string(), - updateReimbursableExpenseTransactionRequest: shared - .UpdateReimbursableExpenseTransactionRequest$outboundSchema.optional(), - }).transform((v) => { - return remap$(v, { - updateReimbursableExpenseTransactionRequest: - "UpdateReimbursableExpenseTransactionRequest", - }); - }); - -export function updateReimbursableExpenseTransactionRequestToJSON( - updateReimbursableExpenseTransactionRequest: - UpdateReimbursableExpenseTransactionRequest, -): string { - return JSON.stringify( - UpdateReimbursableExpenseTransactionRequest$outboundSchema.parse( - updateReimbursableExpenseTransactionRequest, - ), - ); +export interface UpdateReimbursableExpenseTransactionRequest { + companyId: string; + transactionId: string; + updateReimbursableExpenseTransactionRequest?: shared.UpdateReimbursableExpenseTransactionRequest; } diff --git a/sync-for-expenses/src/sdk/models/operations/updatesupplier.ts b/sync-for-expenses/src/sdk/models/operations/updatesupplier.ts index 17fb665a5..73efa4076 100644 --- a/sync-for-expenses/src/sdk/models/operations/updatesupplier.ts +++ b/sync-for-expenses/src/sdk/models/operations/updatesupplier.ts @@ -1,73 +1,14 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; - -export type UpdateSupplierRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a connection. - */ - connectionId: string; - /** - * Unique identifier for a supplier. - */ - supplierId: string; - /** - * Time limit for the push operation to complete before it is timed out. - */ - timeoutInMinutes?: number | undefined; - /** - * Allow a sync upon push completion. - */ - allowSyncOnPushComplete?: boolean | undefined; - /** - * When updating data in the destination platform Codat checks the `sourceModifiedDate` against the `lastupdated` date from the accounting software, if they're different Codat will return an error suggesting you should initiate another pull of the data. If this is set to `true` then the update will override this check. - */ - forceUpdate?: boolean | undefined; - supplier?: shared.Supplier | null | undefined; -}; - -/** @internal */ -export type UpdateSupplierRequest$Outbound = { - companyId: string; - connectionId: string; - supplierId: string; - timeoutInMinutes?: number | undefined; - allowSyncOnPushComplete: boolean; - forceUpdate: boolean; - Supplier?: shared.Supplier$Outbound | null | undefined; -}; - -/** @internal */ -export const UpdateSupplierRequest$outboundSchema: z.ZodType< - UpdateSupplierRequest$Outbound, - z.ZodTypeDef, - UpdateSupplierRequest -> = z.object({ - companyId: z.string(), - connectionId: z.string(), - supplierId: z.string(), - timeoutInMinutes: z.number().int().optional(), - allowSyncOnPushComplete: z.boolean().default(true), - forceUpdate: z.boolean().default(false), - supplier: z.nullable(shared.Supplier$outboundSchema).optional(), -}).transform((v) => { - return remap$(v, { - supplier: "Supplier", - }); -}); - -export function updateSupplierRequestToJSON( - updateSupplierRequest: UpdateSupplierRequest, -): string { - return JSON.stringify( - UpdateSupplierRequest$outboundSchema.parse(updateSupplierRequest), - ); +/* tslint:disable */ + +import type { Supplier } from '../shared/supplier'; +/* eslint-disable */ + +export interface UpdateSupplierRequest { + companyId: string; + connectionId: string; + supplierId: string; + timeoutInMinutes?: number; + allowSyncOnPushComplete?: boolean; + forceUpdate?: boolean; + supplier?: Supplier | undefined; } diff --git a/sync-for-expenses/src/sdk/models/operations/uploadexpenseattachment.ts b/sync-for-expenses/src/sdk/models/operations/uploadexpenseattachment.ts index eef9b6596..ed53355f0 100644 --- a/sync-for-expenses/src/sdk/models/operations/uploadexpenseattachment.ts +++ b/sync-for-expenses/src/sdk/models/operations/uploadexpenseattachment.ts @@ -1,57 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import * as shared from "../shared/index.js"; +import type { AttachmentUpload } from '../shared/attachmentupload'; +/* eslint-disable */ -export type UploadExpenseAttachmentRequest = { - /** - * Unique identifier for a company. - */ - companyId: string; - /** - * Unique identifier for a sync. - */ - syncId: string; - /** - * The unique identifier for your SMB's transaction. - */ - transactionId: string; - attachmentUpload?: shared.AttachmentUpload | undefined; -}; - -/** @internal */ -export type UploadExpenseAttachmentRequest$Outbound = { - companyId: string; - syncId: string; - transactionId: string; - AttachmentUpload?: shared.AttachmentUpload$Outbound | undefined; -}; +export interface UploadExpenseAttachmentRequest { + companyId: string; + syncId: string; + transactionId: string; + attachmentUpload?: AttachmentUpload | undefined; +} -/** @internal */ -export const UploadExpenseAttachmentRequest$outboundSchema: z.ZodType< - UploadExpenseAttachmentRequest$Outbound, - z.ZodTypeDef, - UploadExpenseAttachmentRequest -> = z.object({ - companyId: z.string(), - syncId: z.string(), - transactionId: z.string(), - attachmentUpload: shared.AttachmentUpload$outboundSchema.optional(), -}).transform((v) => { - return remap$(v, { - attachmentUpload: "AttachmentUpload", - }); -}); +export interface ExpenseAttachmentUploadRequestBody { + companyId: string; + syncId: string; + transactionId: string; + attachmentUpload?: AttachmentUpload | undefined; +} -export function uploadExpenseAttachmentRequestToJSON( - uploadExpenseAttachmentRequest: UploadExpenseAttachmentRequest, -): string { - return JSON.stringify( - UploadExpenseAttachmentRequest$outboundSchema.parse( - uploadExpenseAttachmentRequest, - ), - ); +export interface UploadExpenseAttachmentRequestBody { + companyId: string; + syncId: string; + transactionId: string; + attachmentUpload?: AttachmentUpload | undefined; } diff --git a/sync-for-expenses/src/sdk/models/shared/accountingaddress.ts b/sync-for-expenses/src/sdk/models/shared/accountingaddress.ts new file mode 100644 index 000000000..3b2200e55 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/shared/accountingaddress.ts @@ -0,0 +1,844 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +import type { AccountingAddressType } from './accountingaddresstype'; +import { + AccountingAddressTypeFromJSON, + AccountingAddressTypeFromJSONTyped, + AccountingAddressTypeToJSON, + AccountingAddressTypeToJSONTyped, +} from './accountingaddresstype'; + +/** + * + * @export + * @interface AccountingAddress + */ +export interface AccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + + + +/** + * Check if a given object implements the AccountingAddress interface. + */ +export function instanceOfAccountingAddress(value: object): value is AccountingAddress { + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function AccountingAddressFromJSON(json: any): AccountingAddress { + return AccountingAddressFromJSONTyped(json, false); +} + +export function AccountingAddressFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountingAddress { + if (json == null) { + return json; + } + return { + + 'type': AccountingAddressTypeFromJSON(json['type']), + 'line1': json['line1'] == null ? undefined : json['line1'], + 'line2': json['line2'] == null ? undefined : json['line2'], + 'city': json['city'] == null ? undefined : json['city'], + 'region': json['region'] == null ? undefined : json['region'], + 'country': json['country'] == null ? undefined : json['country'], + 'postalCode': json['postalCode'] == null ? undefined : json['postalCode'], + }; +} + +export function AccountingAddressToJSON(json: any): AccountingAddress { + return AccountingAddressToJSONTyped(json, false); +} + +export function AccountingAddressToJSONTyped(value?: AccountingAddress | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': AccountingAddressTypeToJSON(value['type']), + 'line1': value['line1'], + 'line2': value['line2'], + 'city': value['city'], + 'region': value['region'], + 'country': value['country'], + 'postalCode': value['postalCode'], + }; +} + + +export interface AccountingCompanyInformationAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface AccountingCustomerAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface AccountingSupplierAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface CompanyInfoGetResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface CompanyInformationAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface CreateCustomerResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface CreateSupplierResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface CustomerAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface CustomerGetResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface GetCompanyInfoResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface GetCustomerResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface GetSupplierResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface SupplierAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface SupplierGetResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface UpdateCustomerResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} + +export interface UpdateSupplierResponseAccountingAddress { + /** + * + * @type {AccountingAddressType} + * @memberof AccountingAddress + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line1?: string | null; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + line2?: string | null; + /** + * City of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + city?: string | null; + /** + * Region of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + region?: string | null; + /** + * Country of the customer address. + * @type {string} + * @memberof AccountingAddress + */ + country?: string | null; + /** + * Postal code or zip code. + * @type {string} + * @memberof AccountingAddress + */ + postalCode?: string | null; +} diff --git a/sync-for-expenses/src/sdk/models/shared/accountingaddresstype.ts b/sync-for-expenses/src/sdk/models/shared/accountingaddresstype.ts index 2f4e3b7a6..e1f9ef991 100644 --- a/sync-for-expenses/src/sdk/models/shared/accountingaddresstype.ts +++ b/sync-for-expenses/src/sdk/models/shared/accountingaddresstype.ts @@ -1,28 +1,54 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The type of the address + * @export */ export const AccountingAddressType = { - Unknown: "Unknown", - Billing: "Billing", - Delivery: "Delivery", + Unknown: 'Unknown', + Billing: 'Billing', + Delivery: 'Delivery' } as const; -/** - * The type of the address - */ -export type AccountingAddressType = ClosedEnum; - -/** @internal */ -export const AccountingAddressType$inboundSchema: z.ZodNativeEnum< - typeof AccountingAddressType -> = z.nativeEnum(AccountingAddressType); -/** @internal */ -export const AccountingAddressType$outboundSchema: z.ZodNativeEnum< - typeof AccountingAddressType -> = AccountingAddressType$inboundSchema; +export type AccountingAddressType = typeof AccountingAddressType[keyof typeof AccountingAddressType]; + + +export function instanceOfAccountingAddressType(value: any): boolean { + for (const key in AccountingAddressType) { + if (Object.prototype.hasOwnProperty.call(AccountingAddressType, key)) { + if (AccountingAddressType[key as keyof typeof AccountingAddressType] === value) { + return true; + } + } + } + return false; +} + +export function AccountingAddressTypeFromJSON(json: any): AccountingAddressType { + return AccountingAddressTypeFromJSONTyped(json, false); +} + +export function AccountingAddressTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountingAddressType { + return json as AccountingAddressType; +} + +export function AccountingAddressTypeToJSON(value?: AccountingAddressType | null): any { + return value as any; +} + +export function AccountingAddressTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): AccountingAddressType { + return value as AccountingAddressType; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/accountmappinginfo.ts b/sync-for-expenses/src/sdk/models/shared/accountmappinginfo.ts index 7341c4006..51252f7b3 100644 --- a/sync-for-expenses/src/sdk/models/shared/accountmappinginfo.ts +++ b/sync-for-expenses/src/sdk/models/shared/accountmappinginfo.ts @@ -1,103 +1,348 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { ValidFor } from '../_speakeasy_enums'; +import type { ValidTransactionTypes } from '../_speakeasy_enums'; +import type { AccountMappingInfoAccountType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface AccountMappingInfo + */ +export interface AccountMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of account. + * @type {string} + * @memberof AccountMappingInfo + */ + id?: string; + /** + * Code used to identify each nominal account in the accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + nominalCode?: string | null; + /** + * Name of the account as it appears in the company's accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + name?: string; + /** + * Currency of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + currency?: string; + /** + * Type of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + accountType?: AccountMappingInfoAccountType; + /** + * Full account type and category of the account + * @type {string} + * @memberof AccountMappingInfo + */ + fullyQualifiedCategory?: string; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountMappingInfo + */ + isBankAccount?: boolean; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validTransactionTypes?: Array; + /** + * Supported endpoints for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validFor?: Array; +} + + +/** + * @export */ +export const AccountMappingInfoAccountTypeEnum = { + Asset: 'Asset', + Liability: 'Liability', + Income: 'Income', + Expense: 'Expense', + Equity: 'Equity' +} as const; +export type AccountMappingInfoAccountTypeEnum = typeof AccountMappingInfoAccountTypeEnum[keyof typeof AccountMappingInfoAccountTypeEnum]; -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { ValidFor, ValidFor$inboundSchema } from "./validfor.js"; -import { - ValidTransactionTypes, - ValidTransactionTypes$inboundSchema, -} from "./validtransactiontypes.js"; +/** + * @export + */ +export const AccountMappingInfoValidTransactionTypesEnum = { + Payment: 'Payment', + Refund: 'Refund', + Reward: 'Reward', + Chargeback: 'Chargeback' +} as const; +export type AccountMappingInfoValidTransactionTypesEnum = typeof AccountMappingInfoValidTransactionTypesEnum[keyof typeof AccountMappingInfoValidTransactionTypesEnum]; /** - * Type of the account. + * @export */ -export const AccountMappingInfoAccountType = { - Asset: "Asset", - Liability: "Liability", - Income: "Income", - Expense: "Expense", - Equity: "Equity", +export const AccountMappingInfoValidForEnum = { + ExpenseTransactionsPayment: 'expense-transactions.Payment', + ExpenseTransactionsRefund: 'expense-transactions.Refund', + ExpenseTransactionsReward: 'expense-transactions.Reward', + ExpenseTransactionsChargeback: 'expense-transactions.Chargeback', + ReimbursableExpenseTransactions: 'reimbursable-expense-transactions', + TransferTransactions: 'transfer-transactions', + AdjustmentTransactions: 'adjustment-transactions' } as const; +export type AccountMappingInfoValidForEnum = typeof AccountMappingInfoValidForEnum[keyof typeof AccountMappingInfoValidForEnum]; + + /** - * Type of the account. + * Check if a given object implements the AccountMappingInfo interface. */ -export type AccountMappingInfoAccountType = ClosedEnum< - typeof AccountMappingInfoAccountType ->; - -export type AccountMappingInfo = { - /** - * Unique identifier of account. - */ - id?: string | undefined; - /** - * Code used to identify each nominal account in the accounting software. - */ - nominalCode?: string | null | undefined; - /** - * Name of the account as it appears in the company's accounting software. - */ - name?: string | undefined; - /** - * Currency of the account. - */ - currency?: string | undefined; - /** - * Type of the account. - */ - accountType?: AccountMappingInfoAccountType | undefined; - /** - * Full account type and category of the account - */ - fullyQualifiedCategory?: string | undefined; - /** - * Confirms whether the account is a bank account or not. - */ - isBankAccount?: boolean | undefined; - /** - * Supported transaction types for the account. - */ - validTransactionTypes?: Array | undefined; - /** - * Supported endpoints for the account. - */ - validFor?: Array | undefined; -}; - -/** @internal */ -export const AccountMappingInfoAccountType$inboundSchema: z.ZodNativeEnum< - typeof AccountMappingInfoAccountType -> = z.nativeEnum(AccountMappingInfoAccountType); - -/** @internal */ -export const AccountMappingInfo$inboundSchema: z.ZodType< - AccountMappingInfo, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - nominalCode: z.nullable(z.string()).optional(), - name: z.string().optional(), - currency: z.string().optional(), - accountType: AccountMappingInfoAccountType$inboundSchema.optional(), - fullyQualifiedCategory: z.string().optional(), - isBankAccount: z.boolean().optional(), - validTransactionTypes: z.array(ValidTransactionTypes$inboundSchema) - .optional(), - validFor: z.array(ValidFor$inboundSchema).optional(), -}); - -export function accountMappingInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountMappingInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountMappingInfo' from JSON`, - ); +export function instanceOfAccountMappingInfo(value: object): value is AccountMappingInfo { + return true; +} + +export function AccountMappingInfoFromJSON(json: any): AccountMappingInfo { + return AccountMappingInfoFromJSONTyped(json, false); +} + +export function AccountMappingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountMappingInfo { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'] == null ? undefined : json['name'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'fullyQualifiedCategory': json['fullyQualifiedCategory'] == null ? undefined : json['fullyQualifiedCategory'], + 'isBankAccount': json['isBankAccount'] == null ? undefined : json['isBankAccount'], + 'validTransactionTypes': json['validTransactionTypes'] == null ? undefined : json['validTransactionTypes'], + 'validFor': json['validFor'] == null ? undefined : json['validFor'], + }; +} + +export function AccountMappingInfoToJSON(json: any): AccountMappingInfo { + return AccountMappingInfoToJSONTyped(json, false); +} + +export function AccountMappingInfoToJSONTyped(value?: AccountMappingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'currency': value['currency'], + 'accountType': value['accountType'], + 'fullyQualifiedCategory': value['fullyQualifiedCategory'], + 'isBankAccount': value['isBankAccount'], + 'validTransactionTypes': value['validTransactionTypes'], + 'validFor': value['validFor'], + }; +} + + +export interface GetMappingOptionsResponseAccountMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of account. + * @type {string} + * @memberof AccountMappingInfo + */ + id?: string; + /** + * Code used to identify each nominal account in the accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + nominalCode?: string | null; + /** + * Name of the account as it appears in the company's accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + name?: string; + /** + * Currency of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + currency?: string; + /** + * Type of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + accountType?: AccountMappingInfoAccountType; + /** + * Full account type and category of the account + * @type {string} + * @memberof AccountMappingInfo + */ + fullyQualifiedCategory?: string; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountMappingInfo + */ + isBankAccount?: boolean; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validTransactionTypes?: Array; + /** + * Supported endpoints for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validFor?: Array; +} + +export interface MappingOptionsAccountMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of account. + * @type {string} + * @memberof AccountMappingInfo + */ + id?: string; + /** + * Code used to identify each nominal account in the accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + nominalCode?: string | null; + /** + * Name of the account as it appears in the company's accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + name?: string; + /** + * Currency of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + currency?: string; + /** + * Type of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + accountType?: AccountMappingInfoAccountType; + /** + * Full account type and category of the account + * @type {string} + * @memberof AccountMappingInfo + */ + fullyQualifiedCategory?: string; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountMappingInfo + */ + isBankAccount?: boolean; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validTransactionTypes?: Array; + /** + * Supported endpoints for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validFor?: Array; +} + +export interface MappingOptionsGetResponseAccountMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of account. + * @type {string} + * @memberof AccountMappingInfo + */ + id?: string; + /** + * Code used to identify each nominal account in the accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + nominalCode?: string | null; + /** + * Name of the account as it appears in the company's accounting software. + * @type {string} + * @memberof AccountMappingInfo + */ + name?: string; + /** + * Currency of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + currency?: string; + /** + * Type of the account. + * @type {string} + * @memberof AccountMappingInfo + */ + accountType?: AccountMappingInfoAccountType; + /** + * Full account type and category of the account + * @type {string} + * @memberof AccountMappingInfo + */ + fullyQualifiedCategory?: string; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountMappingInfo + */ + isBankAccount?: boolean; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validTransactionTypes?: Array; + /** + * Supported endpoints for the account. + * @type {Array} + * @memberof AccountMappingInfo + */ + validFor?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/accountprototype.ts b/sync-for-expenses/src/sdk/models/shared/accountprototype.ts index cc5b1ee17..8c14d8f3d 100644 --- a/sync-for-expenses/src/sdk/models/shared/accountprototype.ts +++ b/sync-for-expenses/src/sdk/models/shared/accountprototype.ts @@ -1,215 +1,798 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { AccountStatus } from './accountstatus'; import { - AccountStatus, - AccountStatus$outboundSchema, -} from "./accountstatus.js"; -import { AccountType, AccountType$outboundSchema } from "./accounttype.js"; + AccountStatusFromJSON, + AccountStatusFromJSONTyped, + AccountStatusToJSON, + AccountStatusToJSONTyped, +} from './accountstatus'; +import type { SupplementalData } from './supplementaldata'; import { - SupplementalData, - SupplementalData$Outbound, - SupplementalData$outboundSchema, -} from "./supplementaldata.js"; + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './supplementaldata'; +import type { ValidDataTypeLinks } from './validdatatypelinks'; +import { + ValidDataTypeLinksFromJSON, + ValidDataTypeLinksFromJSONTyped, + ValidDataTypeLinksToJSON, + ValidDataTypeLinksToJSONTyped, +} from './validdatatypelinks'; +import type { AccountType } from './accounttype'; +import { + AccountTypeFromJSON, + AccountTypeFromJSONTyped, + AccountTypeToJSON, + AccountTypeToJSONTyped, +} from './accounttype'; /** - * When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. - * - * @remarks - * - * For example, `validDatatypeLinks` might indicate the following references: - * - * - Which tax rates are valid to use on the line item of a bill. - * - Which items can be used when creating an invoice. - * - * You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. - * - * ## `validDatatypeLinks` example - * - * The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. - * - * ```json validDatatypeLinks for an account - * { - * "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", - * "nominalCode": "090", - * "name": "Business Bank Account", - * #... - * "validDatatypeLinks": [ - * { - * "property": "Id", - * "links": [ - * "Payment.AccountRef.Id", - * "BillPayment.AccountRef.Id", - * "DirectIncome.LineItems.AccountRef.Id", - * "DirectCost.LineItems.AccountRef.Id" - * ] - * } - * ] - * } - * ``` - * - * ## Support for `validDatatypeLinks` - * - * Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. - * - * If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + * + * @export + * @interface AccountPrototype */ -export type ValidDataTypeLinks = { - /** - * The property from the account that can be linked. - */ - property?: string | null | undefined; - /** - * Supported `dataTypes` that the record can be linked to. - */ - links?: Array | null | undefined; -}; - -export type AccountPrototype = { - /** - * 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. - */ - nominalCode?: string | null | undefined; - /** - * Name of the account. - */ - name?: string | null | undefined; - /** - * Description for the account. - */ - description?: string | null | undefined; - /** - * Full category of the account. - * - * @remarks - * - * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. - */ - fullyQualifiedCategory?: string | null | undefined; - /** - * Full name of the account, for example: - * - * @remarks - * - `Cash On Hand` - * - `Rents Held In Trust` - * - `Fixed Asset` - */ - fullyQualifiedName?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Current balance in the account. - */ - currentBalance?: Decimal$ | number | null | undefined; - /** - * Type of account - */ - type?: AccountType | undefined; - /** - * Status of the account - */ - status?: AccountStatus | undefined; - /** - * Confirms whether the account is a bank account or not. - */ - isBankAccount?: boolean | undefined; - /** - * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). - */ - validDatatypeLinks?: Array | null | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; - -/** @internal */ -export type ValidDataTypeLinks$Outbound = { - property?: string | null | undefined; - links?: Array | null | undefined; -}; - -/** @internal */ -export const ValidDataTypeLinks$outboundSchema: z.ZodType< - ValidDataTypeLinks$Outbound, - z.ZodTypeDef, - ValidDataTypeLinks -> = z.object({ - property: z.nullable(z.string()).optional(), - links: z.nullable(z.array(z.string())).optional(), -}); - -export function validDataTypeLinksToJSON( - validDataTypeLinks: ValidDataTypeLinks, -): string { - return JSON.stringify( - ValidDataTypeLinks$outboundSchema.parse(validDataTypeLinks), - ); +export interface AccountPrototype { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; +} + + + +/** + * Check if a given object implements the AccountPrototype interface. + */ +export function instanceOfAccountPrototype(value: object): value is AccountPrototype { + return true; +} + +export function AccountPrototypeFromJSON(json: any): AccountPrototype { + return AccountPrototypeFromJSONTyped(json, false); +} + +export function AccountPrototypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountPrototype { + if (json == null) { + return json; + } + return { + + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'fullyQualifiedCategory': json['fullyQualifiedCategory'] == null ? undefined : json['fullyQualifiedCategory'], + 'fullyQualifiedName': json['fullyQualifiedName'] == null ? undefined : json['fullyQualifiedName'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'currentBalance': json['currentBalance'] == null ? undefined : toDecimal(json['currentBalance']), + 'type': json['type'] == null ? undefined : AccountTypeFromJSON(json['type']), + 'status': json['status'] == null ? undefined : AccountStatusFromJSON(json['status']), + 'isBankAccount': json['isBankAccount'] == null ? undefined : json['isBankAccount'], + 'validDatatypeLinks': json['validDatatypeLinks'] == null ? undefined : ((json['validDatatypeLinks'] as Array).map(ValidDataTypeLinksFromJSON)), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + }; +} + +export function AccountPrototypeToJSON(json: any): AccountPrototype { + return AccountPrototypeToJSONTyped(json, false); +} + +export function AccountPrototypeToJSONTyped(value?: AccountPrototype | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'nominalCode': value['nominalCode'], + 'name': value['name'], + 'description': value['description'], + 'fullyQualifiedCategory': value['fullyQualifiedCategory'], + 'fullyQualifiedName': value['fullyQualifiedName'], + 'currency': value['currency'], + 'currentBalance': fromDecimal(value['currentBalance']), + 'type': AccountTypeToJSON(value['type']), + 'status': AccountStatusToJSON(value['status']), + 'isBankAccount': value['isBankAccount'], + 'validDatatypeLinks': value['validDatatypeLinks'] == null ? undefined : ((value['validDatatypeLinks'] as Array).map(ValidDataTypeLinksToJSON)), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + }; +} + + +export interface AccountAccountPrototype { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; +} + +export interface AccountCreateRequestBody { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; +} + +export interface AccountCreateResponseAccountPrototype { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; +} + +export interface AccountingAccountAccountPrototype { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; +} + +export interface CreateAccountAccountPrototype { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; +} + +export interface CreateAccountRequestBody { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; } -/** @internal */ -export type AccountPrototype$Outbound = { - nominalCode?: string | null | undefined; - name?: string | null | undefined; - description?: string | null | undefined; - fullyQualifiedCategory?: string | null | undefined; - fullyQualifiedName?: string | null | undefined; - currency?: string | undefined; - currentBalance?: number | null | undefined; - type?: string | undefined; - status?: string | undefined; - isBankAccount?: boolean | undefined; - validDatatypeLinks?: Array | null | undefined; - supplementalData?: SupplementalData$Outbound | undefined; -}; - -/** @internal */ -export const AccountPrototype$outboundSchema: z.ZodType< - AccountPrototype$Outbound, - z.ZodTypeDef, - AccountPrototype -> = z.object({ - nominalCode: z.nullable(z.string()).optional(), - name: z.nullable(z.string()).optional(), - description: z.nullable(z.string()).optional(), - fullyQualifiedCategory: z.nullable(z.string()).optional(), - fullyQualifiedName: z.nullable(z.string()).optional(), - currency: z.string().optional(), - currentBalance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - type: AccountType$outboundSchema.optional(), - status: AccountStatus$outboundSchema.optional(), - isBankAccount: z.boolean().optional(), - validDatatypeLinks: z.nullable( - z.array(z.lazy(() => ValidDataTypeLinks$outboundSchema)), - ).optional(), - supplementalData: SupplementalData$outboundSchema.optional(), -}); - -export function accountPrototypeToJSON( - accountPrototype: AccountPrototype, -): string { - return JSON.stringify( - AccountPrototype$outboundSchema.parse(accountPrototype), - ); +export interface CreateAccountResponseAccountPrototype { + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + nominalCode?: string | null; + /** + * Name of the account. + * @type {string} + * @memberof AccountPrototype + */ + name?: string | null; + /** + * Description for the account. + * @type {string} + * @memberof AccountPrototype + */ + description?: string | null; + /** + * Full category of the account. + * + * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedCategory?: string | null; + /** + * Full name of the account, for example: + * - `Cash On Hand` + * - `Rents Held In Trust` + * - `Fixed Asset` + * @type {string} + * @memberof AccountPrototype + */ + fullyQualifiedName?: string | null; + /** + * 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. + * @type {string} + * @memberof AccountPrototype + */ + currency?: string; + /** + * Current balance in the account. + * @type {number} + * @memberof AccountPrototype + */ + currentBalance?: Decimal | number | null; + /** + * + * @type {AccountType} + * @memberof AccountPrototype + */ + type?: AccountType; + /** + * + * @type {AccountStatus} + * @memberof AccountPrototype + */ + status?: AccountStatus; + /** + * Confirms whether the account is a bank account or not. + * @type {boolean} + * @memberof AccountPrototype + */ + isBankAccount?: boolean; + /** + * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). + * @type {Array} + * @memberof AccountPrototype + */ + validDatatypeLinks?: Array | null; + /** + * + * @type {SupplementalData} + * @memberof AccountPrototype + */ + supplementalData?: SupplementalData; } diff --git a/sync-for-expenses/src/sdk/models/shared/accountreference.ts b/sync-for-expenses/src/sdk/models/shared/accountreference.ts new file mode 100644 index 000000000..4ad9faa2e --- /dev/null +++ b/sync-for-expenses/src/sdk/models/shared/accountreference.ts @@ -0,0 +1,84 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * Reference of the account you are transferring money from. + * @export + * @interface AccountReference + */ +export interface AccountReference { + /** + * 'id' from the Accounts data type. + * @type {string} + * @memberof AccountReference + */ + id: string; +} + +/** + * Check if a given object implements the AccountReference interface. + */ +export function instanceOfAccountReference(value: object): value is AccountReference { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function AccountReferenceFromJSON(json: any): AccountReference { + return AccountReferenceFromJSONTyped(json, false); +} + +export function AccountReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountReference { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function AccountReferenceToJSON(json: any): AccountReference { + return AccountReferenceToJSONTyped(json, false); +} + +export function AccountReferenceToJSONTyped(value?: AccountReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface TransferAccountReference { + /** + * 'id' from the Accounts data type. + * @type {string} + * @memberof AccountReference + */ + id: string; +} + +export interface TransferTransactionRequestAccountReference { + /** + * 'id' from the Accounts data type. + * @type {string} + * @memberof AccountReference + */ + id: string; +} diff --git a/sync-for-expenses/src/sdk/models/shared/accountstatus.ts b/sync-for-expenses/src/sdk/models/shared/accountstatus.ts index 12278d094..89f735d3a 100644 --- a/sync-for-expenses/src/sdk/models/shared/accountstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/accountstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of the account + * @export */ export const AccountStatus = { - Unknown: "Unknown", - Active: "Active", - Archived: "Archived", - Pending: "Pending", + Unknown: 'Unknown', + Active: 'Active', + Archived: 'Archived', + Pending: 'Pending' } as const; -/** - * Status of the account - */ -export type AccountStatus = ClosedEnum; - -/** @internal */ -export const AccountStatus$inboundSchema: z.ZodNativeEnum< - typeof AccountStatus -> = z.nativeEnum(AccountStatus); -/** @internal */ -export const AccountStatus$outboundSchema: z.ZodNativeEnum< - typeof AccountStatus -> = AccountStatus$inboundSchema; +export type AccountStatus = typeof AccountStatus[keyof typeof AccountStatus]; + + +export function instanceOfAccountStatus(value: any): boolean { + for (const key in AccountStatus) { + if (Object.prototype.hasOwnProperty.call(AccountStatus, key)) { + if (AccountStatus[key as keyof typeof AccountStatus] === value) { + return true; + } + } + } + return false; +} + +export function AccountStatusFromJSON(json: any): AccountStatus { + return AccountStatusFromJSONTyped(json, false); +} + +export function AccountStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountStatus { + return json as AccountStatus; +} + +export function AccountStatusToJSON(value?: AccountStatus | null): any { + return value as any; +} + +export function AccountStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): AccountStatus { + return value as AccountStatus; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/accounttype.ts b/sync-for-expenses/src/sdk/models/shared/accounttype.ts index c71262dc6..30ece1a48 100644 --- a/sync-for-expenses/src/sdk/models/shared/accounttype.ts +++ b/sync-for-expenses/src/sdk/models/shared/accounttype.ts @@ -1,29 +1,57 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Type of account + * @export */ export const AccountType = { - Unknown: "Unknown", - Asset: "Asset", - Expense: "Expense", - Income: "Income", - Liability: "Liability", - Equity: "Equity", + Unknown: 'Unknown', + Asset: 'Asset', + Expense: 'Expense', + Income: 'Income', + Liability: 'Liability', + Equity: 'Equity' } as const; -/** - * Type of account - */ -export type AccountType = ClosedEnum; - -/** @internal */ -export const AccountType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(AccountType); -/** @internal */ -export const AccountType$outboundSchema: z.ZodNativeEnum = - AccountType$inboundSchema; +export type AccountType = typeof AccountType[keyof typeof AccountType]; + + +export function instanceOfAccountType(value: any): boolean { + for (const key in AccountType) { + if (Object.prototype.hasOwnProperty.call(AccountType, key)) { + if (AccountType[key as keyof typeof AccountType] === value) { + return true; + } + } + } + return false; +} + +export function AccountTypeFromJSON(json: any): AccountType { + return AccountTypeFromJSONTyped(json, false); +} + +export function AccountTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): AccountType { + return json as AccountType; +} + +export function AccountTypeToJSON(value?: AccountType | null): any { + return value as any; +} + +export function AccountTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): AccountType { + return value as AccountType; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionline.ts b/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionline.ts index 405552250..1d942b0ab 100644 --- a/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionline.ts +++ b/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionline.ts @@ -1,75 +1,221 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { RecordRef } from './recordref'; import { - InvoiceTo, - InvoiceTo$Outbound, - InvoiceTo$outboundSchema, -} from "./invoiceto.js"; + RecordRefFromJSON, + RecordRefFromJSONTyped, + RecordRefToJSON, + RecordRefToJSONTyped, +} from './recordref'; +import type { InvoiceTo } from './invoiceto'; import { - RecordRef, - RecordRef$Outbound, - RecordRef$outboundSchema, -} from "./recordref.js"; + InvoiceToFromJSON, + InvoiceToFromJSONTyped, + InvoiceToToJSON, + InvoiceToToJSONTyped, +} from './invoiceto'; +import type { TrackingRefAdjustmentTransaction } from './trackingrefadjustmenttransaction'; import { - TrackingRefAdjustmentTransaction, - TrackingRefAdjustmentTransaction$Outbound, - TrackingRefAdjustmentTransaction$outboundSchema, -} from "./trackingrefadjustmenttransaction.js"; + TrackingRefAdjustmentTransactionFromJSON, + TrackingRefAdjustmentTransactionFromJSONTyped, + TrackingRefAdjustmentTransactionToJSON, + TrackingRefAdjustmentTransactionToJSONTyped, +} from './trackingrefadjustmenttransaction'; -export type AdjustmentTransactionLine = { - /** - * Amount of the line. A positive line represents a debit; a negative line represents a credit. - */ - amount: Decimal$ | number; - accountRef: RecordRef; - /** - * Any private, company notes about the transaction. - */ - description?: string | undefined; - trackingRefs?: Array | null | undefined; - /** - * Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. - */ - invoiceTo?: InvoiceTo | null | undefined; -}; +/** + * + * @export + * @interface AdjustmentTransactionLine + */ +export interface AdjustmentTransactionLine { + /** + * Amount of the line. A positive line represents a debit; a negative line represents a credit. + * @type {number} + * @memberof AdjustmentTransactionLine + */ + amount: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof AdjustmentTransactionLine + */ + accountRef: RecordRef; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof AdjustmentTransactionLine + */ + description?: string; + /** + * + * @type {Array} + * @memberof AdjustmentTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof AdjustmentTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} -/** @internal */ -export type AdjustmentTransactionLine$Outbound = { - amount: number; - accountRef: RecordRef$Outbound; - description?: string | undefined; - trackingRefs?: - | Array - | null - | undefined; - invoiceTo?: InvoiceTo$Outbound | null | undefined; -}; +/** + * Check if a given object implements the AdjustmentTransactionLine interface. + */ +export function instanceOfAdjustmentTransactionLine(value: object): value is AdjustmentTransactionLine { + if (!('amount' in value) || value['amount'] === undefined) return false; + if (!('accountRef' in value) || value['accountRef'] === undefined) return false; + return true; +} -/** @internal */ -export const AdjustmentTransactionLine$outboundSchema: z.ZodType< - AdjustmentTransactionLine$Outbound, - z.ZodTypeDef, - AdjustmentTransactionLine -> = z.object({ - amount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - accountRef: RecordRef$outboundSchema, - description: z.string().optional(), - trackingRefs: z.nullable( - z.array(TrackingRefAdjustmentTransaction$outboundSchema), - ).optional(), - invoiceTo: z.nullable(InvoiceTo$outboundSchema).optional(), -}); +export function AdjustmentTransactionLineFromJSON(json: any): AdjustmentTransactionLine { + return AdjustmentTransactionLineFromJSONTyped(json, false); +} + +export function AdjustmentTransactionLineFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdjustmentTransactionLine { + if (json == null) { + return json; + } + return { + + 'amount': json['amount'], + 'accountRef': RecordRefFromJSON(json['accountRef']), + 'description': json['description'] == null ? undefined : json['description'], + 'trackingRefs': json['trackingRefs'] == null ? undefined : ((json['trackingRefs'] as Array).map(TrackingRefAdjustmentTransactionFromJSON)), + 'invoiceTo': json['invoiceTo'] == null ? undefined : InvoiceToFromJSON(json['invoiceTo']), + }; +} + +export function AdjustmentTransactionLineToJSON(json: any): AdjustmentTransactionLine { + return AdjustmentTransactionLineToJSONTyped(json, false); +} + +export function AdjustmentTransactionLineToJSONTyped(value?: AdjustmentTransactionLine | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'amount': fromDecimal(value['amount']), + 'accountRef': RecordRefToJSON(value['accountRef']), + 'description': value['description'], + 'trackingRefs': value['trackingRefs'] == null ? undefined : ((value['trackingRefs'] as Array).map(TrackingRefAdjustmentTransactionToJSON)), + 'invoiceTo': InvoiceToToJSON(value['invoiceTo']), + }; +} + + +export interface AdjustmentTransactionAdjustmentTransactionLine { + /** + * Amount of the line. A positive line represents a debit; a negative line represents a credit. + * @type {number} + * @memberof AdjustmentTransactionLine + */ + amount: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof AdjustmentTransactionLine + */ + accountRef: RecordRef; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof AdjustmentTransactionLine + */ + description?: string; + /** + * + * @type {Array} + * @memberof AdjustmentTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof AdjustmentTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} + +export interface AdjustmentTransactionRequestAdjustmentTransactionLine { + /** + * Amount of the line. A positive line represents a debit; a negative line represents a credit. + * @type {number} + * @memberof AdjustmentTransactionLine + */ + amount: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof AdjustmentTransactionLine + */ + accountRef: RecordRef; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof AdjustmentTransactionLine + */ + description?: string; + /** + * + * @type {Array} + * @memberof AdjustmentTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof AdjustmentTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} -export function adjustmentTransactionLineToJSON( - adjustmentTransactionLine: AdjustmentTransactionLine, -): string { - return JSON.stringify( - AdjustmentTransactionLine$outboundSchema.parse(adjustmentTransactionLine), - ); +export interface CreateAdjustmentRequestAdjustmentTransactionLine { + /** + * Amount of the line. A positive line represents a debit; a negative line represents a credit. + * @type {number} + * @memberof AdjustmentTransactionLine + */ + amount: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof AdjustmentTransactionLine + */ + accountRef: RecordRef; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof AdjustmentTransactionLine + */ + description?: string; + /** + * + * @type {Array} + * @memberof AdjustmentTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof AdjustmentTransactionLine + */ + invoiceTo?: InvoiceTo | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionrequest.ts b/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionrequest.ts index 211f76e27..854886d3b 100644 --- a/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionrequest.ts +++ b/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionrequest.ts @@ -1,126 +1,499 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { AdjustmentTransactionLine } from './adjustmenttransactionline'; import { - AdjustmentTransactionLine, - AdjustmentTransactionLine$Outbound, - AdjustmentTransactionLine$outboundSchema, -} from "./adjustmenttransactionline.js"; + AdjustmentTransactionLineFromJSON, + AdjustmentTransactionLineFromJSONTyped, + AdjustmentTransactionLineToJSON, + AdjustmentTransactionLineToJSONTyped, +} from './adjustmenttransactionline'; -export type AdjustmentTransactionRequest = { - /** - * Your unique identifier for the transaction. - */ - id: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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; - /** - * Currency the transaction was recorded in. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - /** - * User-friendly reference for the adjustment transaction. - */ - reference?: string | null | undefined; - /** - * Array of transaction lines. - */ - lines: Array; -}; +/** + * + * @export + * @interface AdjustmentTransactionRequest + */ +export interface AdjustmentTransactionRequest { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + id: string; + /** + * Date of the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + date: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof AdjustmentTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * User-friendly reference for the adjustment transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + reference?: string | null; + /** + * Array of transaction lines. + * @type {Array} + * @memberof AdjustmentTransactionRequest + */ + lines: Array; +} + +/** + * Check if a given object implements the AdjustmentTransactionRequest interface. + */ +export function instanceOfAdjustmentTransactionRequest(value: object): value is AdjustmentTransactionRequest { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('date' in value) || value['date'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + if (!('lines' in value) || value['lines'] === undefined) return false; + return true; +} + +export function AdjustmentTransactionRequestFromJSON(json: any): AdjustmentTransactionRequest { + return AdjustmentTransactionRequestFromJSONTyped(json, false); +} + +export function AdjustmentTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdjustmentTransactionRequest { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'date': json['date'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'reference': json['reference'] == null ? undefined : json['reference'], + 'lines': ((json['lines'] as Array).map(AdjustmentTransactionLineFromJSON)), + }; +} + +export function AdjustmentTransactionRequestToJSON(json: any): AdjustmentTransactionRequest { + return AdjustmentTransactionRequestToJSONTyped(json, false); +} -/** @internal */ -export type AdjustmentTransactionRequest$Outbound = { - id: string; - date: string; - currency: string; - currencyRate?: number | null | undefined; - reference?: string | null | undefined; - lines: Array; -}; +export function AdjustmentTransactionRequestToJSONTyped(value?: AdjustmentTransactionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -/** @internal */ -export const AdjustmentTransactionRequest$outboundSchema: z.ZodType< - AdjustmentTransactionRequest$Outbound, - z.ZodTypeDef, - AdjustmentTransactionRequest -> = z.object({ - id: z.string(), - date: z.string(), - currency: z.string(), - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - reference: z.nullable(z.string()).optional(), - lines: z.array(AdjustmentTransactionLine$outboundSchema), -}); + return { + + 'id': value['id'], + 'date': value['date'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'reference': value['reference'], + 'lines': ((value['lines'] as Array).map(AdjustmentTransactionLineToJSON)), + }; +} + + +export interface AdjustmentTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + id: string; + /** + * Date of the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + date: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof AdjustmentTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * User-friendly reference for the adjustment transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + reference?: string | null; + /** + * Array of transaction lines. + * @type {Array} + * @memberof AdjustmentTransactionRequest + */ + lines: Array; +} + +export interface AdjustmentTransactionRequestAdjustmentTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + id: string; + /** + * Date of the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + date: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof AdjustmentTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * User-friendly reference for the adjustment transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + reference?: string | null; + /** + * Array of transaction lines. + * @type {Array} + * @memberof AdjustmentTransactionRequest + */ + lines: Array; +} + +export interface CreateAdjustmentRequest { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + id: string; + /** + * Date of the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + date: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof AdjustmentTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * User-friendly reference for the adjustment transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + reference?: string | null; + /** + * Array of transaction lines. + * @type {Array} + * @memberof AdjustmentTransactionRequest + */ + lines: Array; +} + +export interface CreateAdjustmentRequestAdjustmentTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + id: string; + /** + * Date of the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + date: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof AdjustmentTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * User-friendly reference for the adjustment transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + reference?: string | null; + /** + * Array of transaction lines. + * @type {Array} + * @memberof AdjustmentTransactionRequest + */ + lines: Array; +} -export function adjustmentTransactionRequestToJSON( - adjustmentTransactionRequest: AdjustmentTransactionRequest, -): string { - return JSON.stringify( - AdjustmentTransactionRequest$outboundSchema.parse( - adjustmentTransactionRequest, - ), - ); +export interface CreateAdjustmentRequestAdjustmentTransactionRequest { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + id: string; + /** + * Date of the transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + date: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof AdjustmentTransactionRequest + */ + currencyRate?: Decimal | number | null; + /** + * User-friendly reference for the adjustment transaction. + * @type {string} + * @memberof AdjustmentTransactionRequest + */ + reference?: string | null; + /** + * Array of transaction lines. + * @type {Array} + * @memberof AdjustmentTransactionRequest + */ + lines: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionresponse.ts b/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionresponse.ts index 4edb3094b..c7879e425 100644 --- a/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/adjustmenttransactionresponse.ts @@ -1,34 +1,119 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type AdjustmentTransactionResponse = { - /** - * Unique id of sync created - */ - syncId?: string | undefined; -}; - -/** @internal */ -export const AdjustmentTransactionResponse$inboundSchema: z.ZodType< - AdjustmentTransactionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string().optional(), -}); - -export function adjustmentTransactionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AdjustmentTransactionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AdjustmentTransactionResponse' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface AdjustmentTransactionResponse + */ +export interface AdjustmentTransactionResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; +} + +/** + * Check if a given object implements the AdjustmentTransactionResponse interface. + */ +export function instanceOfAdjustmentTransactionResponse(value: object): value is AdjustmentTransactionResponse { + return true; +} + +export function AdjustmentTransactionResponseFromJSON(json: any): AdjustmentTransactionResponse { + return AdjustmentTransactionResponseFromJSONTyped(json, false); +} + +export function AdjustmentTransactionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AdjustmentTransactionResponse { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + }; +} + +export function AdjustmentTransactionResponseToJSON(json: any): AdjustmentTransactionResponse { + return AdjustmentTransactionResponseToJSONTyped(json, false); +} + +export function AdjustmentTransactionResponseToJSONTyped(value?: AdjustmentTransactionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + }; +} + + +export interface AdjustmentResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; +} + +export interface AdjustmentTransactionCreateResponseAdjustmentResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; +} + +export interface AdjustmentTransactionCreateResponseAdjustmentTransactionResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; +} + +export interface AdjustmentTransactionResponseAdjustmentResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; +} + +export interface CreateAdjustmentTransactionResponseAdjustmentResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; +} + +export interface CreateAdjustmentTransactionResponseAdjustmentTransactionResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof AdjustmentTransactionResponse + */ + syncId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/apaccountref.ts b/sync-for-expenses/src/sdk/models/shared/apaccountref.ts index a40de9884..073ac10e8 100644 --- a/sync-for-expenses/src/sdk/models/shared/apaccountref.ts +++ b/sync-for-expenses/src/sdk/models/shared/apaccountref.ts @@ -1,30 +1,137 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type ApAccountRef = { - /** - * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. - */ - id?: string | undefined; -}; - -/** @internal */ -export type ApAccountRef$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const ApAccountRef$outboundSchema: z.ZodType< - ApAccountRef$Outbound, - z.ZodTypeDef, - ApAccountRef -> = z.object({ - id: z.string().optional(), -}); - -export function apAccountRefToJSON(apAccountRef: ApAccountRef): string { - return JSON.stringify(ApAccountRef$outboundSchema.parse(apAccountRef)); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ApAccountRef + */ +export interface ApAccountRef { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +/** + * Check if a given object implements the ApAccountRef interface. + */ +export function instanceOfApAccountRef(value: object): value is ApAccountRef { + return true; +} + +export function ApAccountRefFromJSON(json: any): ApAccountRef { + return ApAccountRefFromJSONTyped(json, false); +} + +export function ApAccountRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ApAccountRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function ApAccountRefToJSON(json: any): ApAccountRef { + return ApAccountRefToJSONTyped(json, false); +} + +export function ApAccountRefToJSONTyped(value?: ApAccountRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface AccountsPayableAccountReference { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface ApAccountRefAccountsPayableAccountReference { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface ReimbursableExpenseTransactionRequestAccountsPayableAccountReference { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface ReimbursableExpenseTransactionRequestApAccountRef { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestAccountsPayableAccountReference { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestApAccountRef { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestAccountsPayableAccountReference { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestApAccountRef { + /** + * Unique identifier for the Accounts Payable account associated with the transaction. The `apAccountRef` object is currently supported only for QuickBooks Desktop. + * @type {string} + * @memberof ApAccountRef + */ + id?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/attachment.ts b/sync-for-expenses/src/sdk/models/shared/attachment.ts index 795c67ad8..09b0297c4 100644 --- a/sync-for-expenses/src/sdk/models/shared/attachment.ts +++ b/sync-for-expenses/src/sdk/models/shared/attachment.ts @@ -1,44 +1,123 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Attachment = { - /** - * Unique ID of company in Codat - */ - companyId?: string | undefined; - /** - * Unique identifier of attachment - */ - id?: string | undefined; - /** - * Unique identifier of transaction - */ - transactionId?: string | undefined; -}; - -/** @internal */ -export const Attachment$inboundSchema: z.ZodType< - Attachment, - z.ZodTypeDef, - unknown -> = z.object({ - companyId: z.string().optional(), - id: z.string().optional(), - transactionId: z.string().optional(), -}); - -export function attachmentFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Attachment$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Attachment' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface Attachment + */ +export interface Attachment { + /** + * Unique ID of company in Codat + * @type {string} + * @memberof Attachment + */ + companyId?: string; + /** + * Unique identifier of attachment + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Unique identifier of transaction + * @type {string} + * @memberof Attachment + */ + transactionId?: string; +} + +/** + * Check if a given object implements the Attachment interface. + */ +export function instanceOfAttachment(value: object): value is Attachment { + return true; +} + +export function AttachmentFromJSON(json: any): Attachment { + return AttachmentFromJSONTyped(json, false); +} + +export function AttachmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Attachment { + if (json == null) { + return json; + } + return { + + 'companyId': json['companyId'] == null ? undefined : json['companyId'], + 'id': json['id'] == null ? undefined : json['id'], + 'transactionId': json['transactionId'] == null ? undefined : json['transactionId'], + }; +} + +export function AttachmentToJSON(json: any): Attachment { + return AttachmentToJSONTyped(json, false); +} + +export function AttachmentToJSONTyped(value?: Attachment | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyId': value['companyId'], + 'id': value['id'], + 'transactionId': value['transactionId'], + }; +} + + +export interface ExpenseAttachmentUploadResponseAttachment { + /** + * Unique ID of company in Codat + * @type {string} + * @memberof Attachment + */ + companyId?: string; + /** + * Unique identifier of attachment + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Unique identifier of transaction + * @type {string} + * @memberof Attachment + */ + transactionId?: string; +} + +export interface UploadExpenseAttachmentResponseAttachment { + /** + * Unique ID of company in Codat + * @type {string} + * @memberof Attachment + */ + companyId?: string; + /** + * Unique identifier of attachment + * @type {string} + * @memberof Attachment + */ + id?: string; + /** + * Unique identifier of transaction + * @type {string} + * @memberof Attachment + */ + transactionId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/attachmentupload.ts b/sync-for-expenses/src/sdk/models/shared/attachmentupload.ts index 9d175ab21..1ef43649c 100644 --- a/sync-for-expenses/src/sdk/models/shared/attachmentupload.ts +++ b/sync-for-expenses/src/sdk/models/shared/attachmentupload.ts @@ -1,40 +1,16 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -import * as z from "zod/v3"; -import { blobLikeSchema } from "../../types/blobs.js"; -import { - CodatFile, - CodatFile$Outbound, - CodatFile$outboundSchema, -} from "./codatfile.js"; +import type { CodatFile } from './codatfile'; export type AttachmentUpload = { - /** - * The file to be uploaded as an attachment. - */ - file: CodatFile | Blob; + file: CodatFile | Blob; }; -/** @internal */ -export type AttachmentUpload$Outbound = { - file: CodatFile$Outbound | Blob; -}; - -/** @internal */ -export const AttachmentUpload$outboundSchema: z.ZodType< - AttachmentUpload$Outbound, - z.ZodTypeDef, - AttachmentUpload -> = z.object({ - file: CodatFile$outboundSchema.or(blobLikeSchema), -}); +export function AttachmentUploadFromJSON(json: any): AttachmentUpload { + return json; +} -export function attachmentUploadToJSON( - attachmentUpload: AttachmentUpload, -): string { - return JSON.stringify( - AttachmentUpload$outboundSchema.parse(attachmentUpload), - ); +export function AttachmentUploadToJSON(value?: AttachmentUpload | null): any { + return value; } diff --git a/sync-for-expenses/src/sdk/models/shared/bankaccount.ts b/sync-for-expenses/src/sdk/models/shared/bankaccount.ts index 433ac67bc..0db81666c 100644 --- a/sync-for-expenses/src/sdk/models/shared/bankaccount.ts +++ b/sync-for-expenses/src/sdk/models/shared/bankaccount.ts @@ -1,222 +1,1518 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; +import type { CreateBankAccountResponseBankAccountType } from '../_speakeasy_enums'; +import type { BankAccountType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { SupplementalData } from './supplementaldata'; import { - BankAccountStatus, - BankAccountStatus$outboundSchema, -} from "./bankaccountstatus.js"; + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './supplementaldata'; +import type { Metadata } from './metadata'; import { - Metadata, - Metadata$Outbound, - Metadata$outboundSchema, -} from "./metadata.js"; + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './metadata'; +import type { BankAccountStatus } from './bankaccountstatus'; import { - SupplementalData, - SupplementalData$Outbound, - SupplementalData$outboundSchema, -} from "./supplementaldata.js"; - -/** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ -export const BankAccountType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", -} as const; -/** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ -export type BankAccountType = ClosedEnum; + BankAccountStatusFromJSON, + BankAccountStatusFromJSONTyped, + BankAccountStatusToJSON, + BankAccountStatusToJSONTyped, +} from './bankaccountstatus'; /** * > **Accessing Bank Accounts through Banking API** - * - * @remarks - * > - * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. - * > + * > + * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. + * > * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. - * + * * ## Overview - * + * * A list of bank accounts associated with a company and a specific data connection. - * + * * Bank accounts data includes: * * The name and ID of the account in the accounting software. * * The currency and balance of the account. * * The sort code and account number. + * @export + * @interface BankAccount */ -export type BankAccount = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the account, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the bank account in the accounting software. - */ - accountName?: string | null | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: BankAccountType | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Sort code for the bank account. - * - * @remarks - * - * 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. - */ - sortCode?: string | null | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * 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. - */ - accountNumber?: string | null | undefined; - /** - * International bank account number of the account. Often used when making or receiving international payments. - */ - iBan?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Balance of the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * The institution of the bank account. - */ - institution?: string | null | undefined; - /** - * 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. - */ - availableBalance?: Decimal$ | number | null | undefined; - /** - * Pre-arranged overdraft limit of the account. - * - * @remarks - * - * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. - */ - overdraftLimit?: Decimal$ | number | null | undefined; - /** - * Status of the bank account. - */ - status?: BankAccountStatus | undefined; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; - -/** @internal */ -export const BankAccountType$outboundSchema: z.ZodNativeEnum< - typeof BankAccountType -> = z.nativeEnum(BankAccountType); - -/** @internal */ -export type BankAccount$Outbound = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - id?: string | undefined; - accountName?: string | null | undefined; - accountType?: string | undefined; - nominalCode?: string | null | undefined; - sortCode?: string | null | undefined; - accountNumber?: string | null | undefined; - iBan?: string | null | undefined; - currency?: string | undefined; - balance?: number | null | undefined; - institution?: string | null | undefined; - availableBalance?: number | null | undefined; - overdraftLimit?: number | null | undefined; - status?: string | undefined; - metadata?: Metadata$Outbound | undefined; - supplementalData?: SupplementalData$Outbound | undefined; -}; - -/** @internal */ -export const BankAccount$outboundSchema: z.ZodType< - BankAccount$Outbound, - z.ZodTypeDef, - BankAccount -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - accountName: z.nullable(z.string()).optional(), - accountType: BankAccountType$outboundSchema.optional(), - nominalCode: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - iBan: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - institution: z.nullable(z.string()).optional(), - availableBalance: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - overdraftLimit: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - status: BankAccountStatus$outboundSchema.optional(), - metadata: Metadata$outboundSchema.optional(), - supplementalData: SupplementalData$outboundSchema.optional(), -}); - -export function bankAccountToJSON(bankAccount: BankAccount): string { - return JSON.stringify(BankAccount$outboundSchema.parse(bankAccount)); +export interface BankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + + +/** + * @export + */ +export const BankAccountAccountTypeEnum = { + Unknown: 'Unknown', + Credit: 'Credit', + Debit: 'Debit' +} as const; +export type BankAccountAccountTypeEnum = typeof BankAccountAccountTypeEnum[keyof typeof BankAccountAccountTypeEnum]; + + +/** + * Check if a given object implements the BankAccount interface. + */ +export function instanceOfBankAccount(value: object): value is BankAccount { + return true; +} + +export function BankAccountFromJSON(json: any): BankAccount { + return BankAccountFromJSONTyped(json, false); +} + +export function BankAccountFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccount { + if (json == null) { + return json; + } + return { + + 'accountName': json['accountName'] == null ? undefined : json['accountName'], + 'accountType': json['accountType'] == null ? undefined : json['accountType'], + 'nominalCode': json['nominalCode'] == null ? undefined : json['nominalCode'], + 'sortCode': json['sortCode'] == null ? undefined : json['sortCode'], + 'accountNumber': json['accountNumber'] == null ? undefined : json['accountNumber'], + 'iBan': json['iBan'] == null ? undefined : json['iBan'], + 'currency': json['currency'] == null ? undefined : json['currency'], + 'balance': json['balance'] == null ? undefined : toDecimal(json['balance']), + 'institution': json['institution'] == null ? undefined : json['institution'], + 'availableBalance': json['availableBalance'] == null ? undefined : toDecimal(json['availableBalance']), + 'overdraftLimit': json['overdraftLimit'] == null ? undefined : toDecimal(json['overdraftLimit']), + 'status': json['status'] == null ? undefined : BankAccountStatusFromJSON(json['status']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + 'id': json['id'] == null ? undefined : json['id'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + }; +} + +export function BankAccountToJSON(json: any): BankAccount { + return BankAccountToJSONTyped(json, false); +} + +export function BankAccountToJSONTyped(value?: BankAccount | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'accountName': value['accountName'], + 'accountType': value['accountType'], + 'nominalCode': value['nominalCode'], + 'sortCode': value['sortCode'], + 'accountNumber': value['accountNumber'], + 'iBan': value['iBan'], + 'currency': value['currency'], + 'balance': fromDecimal(value['balance']), + 'institution': value['institution'], + 'availableBalance': fromDecimal(value['availableBalance']), + 'overdraftLimit': fromDecimal(value['overdraftLimit']), + 'status': BankAccountStatusToJSON(value['status']), + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + 'id': value['id'], + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + }; +} + + +export interface AccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: CreateBankAccountResponseBankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface BankAccountAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface BankAccountCreateRequestBody { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface BankAccountCreateResponseAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface BankAccountCreateResponseBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface CreateBankAccountBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface CreateBankAccountRequestBody { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface CreateBankAccountResponseAccountingBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; +} + +export interface CreateBankAccountResponseBankAccount { + /** + * Name of the bank account in the accounting software. + * @type {string} + * @memberof BankAccount + */ + accountName?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountType?: BankAccountType; + /** + * Code used to identify each nominal account for a business. + * @type {string} + * @memberof BankAccount + */ + nominalCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + sortCode?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + accountNumber?: string | null; + /** + * International bank account number of the account. Often used when making or receiving international payments. + * @type {string} + * @memberof BankAccount + */ + iBan?: string | null; + /** + * 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. + * @type {string} + * @memberof BankAccount + */ + currency?: string; + /** + * Balance of the bank account. + * @type {number} + * @memberof BankAccount + */ + balance?: Decimal | number | null; + /** + * The institution of the bank account. + * @type {string} + * @memberof BankAccount + */ + institution?: string | null; + /** + * 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. + * @type {number} + * @memberof BankAccount + */ + availableBalance?: Decimal | number | null; + /** + * 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`. + * @type {number} + * @memberof BankAccount + */ + overdraftLimit?: Decimal | number | null; + /** + * + * @type {BankAccountStatus} + * @memberof BankAccount + */ + status?: BankAccountStatus; + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof BankAccount + */ + sourceModifiedDate?: string; + /** + * Identifier for the account, unique for the company in the accounting software. + * @type {string} + * @memberof BankAccount + */ + id?: string; + /** + * + * @type {Metadata} + * @memberof BankAccount + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof BankAccount + */ + supplementalData?: SupplementalData; } diff --git a/sync-for-expenses/src/sdk/models/shared/bankaccountdetails.ts b/sync-for-expenses/src/sdk/models/shared/bankaccountdetails.ts index 3f1bddb89..e7c3f0375 100644 --- a/sync-for-expenses/src/sdk/models/shared/bankaccountdetails.ts +++ b/sync-for-expenses/src/sdk/models/shared/bankaccountdetails.ts @@ -1,54 +1,110 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type BankAccountDetails = { - /** - * The id of the account from which purchases are made - */ - id?: string | undefined; -}; - -/** @internal */ -export const BankAccountDetails$inboundSchema: z.ZodType< - BankAccountDetails, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), -}); -/** @internal */ -export type BankAccountDetails$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const BankAccountDetails$outboundSchema: z.ZodType< - BankAccountDetails$Outbound, - z.ZodTypeDef, - BankAccountDetails -> = z.object({ - id: z.string().optional(), -}); - -export function bankAccountDetailsToJSON( - bankAccountDetails: BankAccountDetails, -): string { - return JSON.stringify( - BankAccountDetails$outboundSchema.parse(bankAccountDetails), - ); -} -export function bankAccountDetailsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => BankAccountDetails$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'BankAccountDetails' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface BankAccountDetails + */ +export interface BankAccountDetails { + /** + * The id of the account from which purchases are made + * @type {string} + * @memberof BankAccountDetails + */ + id?: string; +} + +/** + * Check if a given object implements the BankAccountDetails interface. + */ +export function instanceOfBankAccountDetails(value: object): value is BankAccountDetails { + return true; +} + +export function BankAccountDetailsFromJSON(json: any): BankAccountDetails { + return BankAccountDetailsFromJSONTyped(json, false); +} + +export function BankAccountDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function BankAccountDetailsToJSON(json: any): BankAccountDetails { + return BankAccountDetailsToJSONTyped(json, false); +} + +export function BankAccountDetailsToJSONTyped(value?: BankAccountDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface CompanyConfigurationBankAccountDetails { + /** + * The id of the account from which purchases are made + * @type {string} + * @memberof BankAccountDetails + */ + id?: string; +} + +export interface CompanyConfigurationGetResponseBankAccountDetails { + /** + * The id of the account from which purchases are made + * @type {string} + * @memberof BankAccountDetails + */ + id?: string; +} + +export interface CompanyConfigurationSetResponseBankAccountDetails { + /** + * The id of the account from which purchases are made + * @type {string} + * @memberof BankAccountDetails + */ + id?: string; +} + +export interface GetCompanyConfigurationResponseBankAccountDetails { + /** + * The id of the account from which purchases are made + * @type {string} + * @memberof BankAccountDetails + */ + id?: string; +} + +export interface SetCompanyConfigurationResponseBankAccountDetails { + /** + * The id of the account from which purchases are made + * @type {string} + * @memberof BankAccountDetails + */ + id?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/bankaccountreference.ts b/sync-for-expenses/src/sdk/models/shared/bankaccountreference.ts new file mode 100644 index 000000000..d291e40ba --- /dev/null +++ b/sync-for-expenses/src/sdk/models/shared/bankaccountreference.ts @@ -0,0 +1,101 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface BankAccountReference + */ +export interface BankAccountReference { + /** + * Identifier of the bank account. + * @type {string} + * @memberof BankAccountReference + */ + id?: string; +} + +/** + * Check if a given object implements the BankAccountReference interface. + */ +export function instanceOfBankAccountReference(value: object): value is BankAccountReference { + return true; +} + +export function BankAccountReferenceFromJSON(json: any): BankAccountReference { + return BankAccountReferenceFromJSONTyped(json, false); +} + +export function BankAccountReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountReference { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function BankAccountReferenceToJSON(json: any): BankAccountReference { + return BankAccountReferenceToJSONTyped(json, false); +} + +export function BankAccountReferenceToJSONTyped(value?: BankAccountReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface CreateExpenseRequestBankAccountReference { + /** + * Identifier of the bank account. + * @type {string} + * @memberof BankAccountReference + */ + id?: string; +} + +export interface ExpenseTransactionBankAccountReference { + /** + * Identifier of the bank account. + * @type {string} + * @memberof BankAccountReference + */ + id?: string; +} + +export interface UpdateExpenseRequestBankAccountReference { + /** + * Identifier of the bank account. + * @type {string} + * @memberof BankAccountReference + */ + id?: string; +} + +export interface UpdatingExpenseTransactionRequestBankAccountReference { + /** + * Identifier of the bank account. + * @type {string} + * @memberof BankAccountReference + */ + id?: string; +} diff --git a/sync-for-expenses/src/sdk/models/shared/bankaccountstatus.ts b/sync-for-expenses/src/sdk/models/shared/bankaccountstatus.ts index bca71b030..447fa3ede 100644 --- a/sync-for-expenses/src/sdk/models/shared/bankaccountstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/bankaccountstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of the bank account. + * @export */ export const BankAccountStatus = { - Unknown: "Unknown", - Active: "Active", - Archived: "Archived", - Pending: "Pending", + Unknown: 'Unknown', + Active: 'Active', + Archived: 'Archived', + Pending: 'Pending' } as const; -/** - * Status of the bank account. - */ -export type BankAccountStatus = ClosedEnum; - -/** @internal */ -export const BankAccountStatus$inboundSchema: z.ZodNativeEnum< - typeof BankAccountStatus -> = z.nativeEnum(BankAccountStatus); -/** @internal */ -export const BankAccountStatus$outboundSchema: z.ZodNativeEnum< - typeof BankAccountStatus -> = BankAccountStatus$inboundSchema; +export type BankAccountStatus = typeof BankAccountStatus[keyof typeof BankAccountStatus]; + + +export function instanceOfBankAccountStatus(value: any): boolean { + for (const key in BankAccountStatus) { + if (Object.prototype.hasOwnProperty.call(BankAccountStatus, key)) { + if (BankAccountStatus[key as keyof typeof BankAccountStatus] === value) { + return true; + } + } + } + return false; +} + +export function BankAccountStatusFromJSON(json: any): BankAccountStatus { + return BankAccountStatusFromJSONTyped(json, false); +} + +export function BankAccountStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): BankAccountStatus { + return json as BankAccountStatus; +} + +export function BankAccountStatusToJSON(value?: BankAccountStatus | null): any { + return value as any; +} + +export function BankAccountStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): BankAccountStatus { + return value as BankAccountStatus; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhook.ts b/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhook.ts index cdc40c0b8..54569c227 100644 --- a/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhook.ts +++ b/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhook.ts @@ -1,96 +1,97 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ClientRateLimitWebhookPayload } from './clientratelimitwebhookpayload'; import { - ClientRateLimitWebhookPayload, - ClientRateLimitWebhookPayload$inboundSchema, - ClientRateLimitWebhookPayload$Outbound, - ClientRateLimitWebhookPayload$outboundSchema, -} from "./clientratelimitwebhookpayload.js"; + ClientRateLimitWebhookPayloadFromJSON, + ClientRateLimitWebhookPayloadFromJSONTyped, + ClientRateLimitWebhookPayloadToJSON, + ClientRateLimitWebhookPayloadToJSONTyped, +} from './clientratelimitwebhookpayload'; -export type ClientRateLimitWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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 | undefined; - payload?: ClientRateLimitWebhookPayload | undefined; -}; +/** + * + * @export + * @interface ClientRateLimitWebhook + */ +export interface ClientRateLimitWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + eventType?: string; + /** + * The date time in UTC the event was generated in Codat. + * @type {string} + * @memberof ClientRateLimitWebhook + */ + generatedDate?: string; + /** + * + * @type {ClientRateLimitWebhookPayload} + * @memberof ClientRateLimitWebhook + */ + payload?: ClientRateLimitWebhookPayload; +} + +/** + * Check if a given object implements the ClientRateLimitWebhook interface. + */ +export function instanceOfClientRateLimitWebhook(value: object): value is ClientRateLimitWebhook { + return true; +} -/** @internal */ -export const ClientRateLimitWebhook$inboundSchema: z.ZodType< - ClientRateLimitWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ClientRateLimitWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ClientRateLimitWebhookPayload$Outbound | undefined; -}; +export function ClientRateLimitWebhookFromJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookFromJSONTyped(json, false); +} -/** @internal */ -export const ClientRateLimitWebhook$outboundSchema: z.ZodType< - ClientRateLimitWebhook$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ClientRateLimitWebhookPayload$outboundSchema.optional(), -}); +export function ClientRateLimitWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ClientRateLimitWebhookPayloadFromJSON(json['payload']), + }; +} -export function clientRateLimitWebhookToJSON( - clientRateLimitWebhook: ClientRateLimitWebhook, -): string { - return JSON.stringify( - ClientRateLimitWebhook$outboundSchema.parse(clientRateLimitWebhook), - ); +export function ClientRateLimitWebhookToJSON(json: any): ClientRateLimitWebhook { + return ClientRateLimitWebhookToJSONTyped(json, false); } -export function clientRateLimitWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhook' from JSON`, - ); + +export function ClientRateLimitWebhookToJSONTyped(value?: ClientRateLimitWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ClientRateLimitWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhookpayload.ts b/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhookpayload.ts index 72605d624..eab7185cb 100644 --- a/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhookpayload.ts +++ b/sync-for-expenses/src/sdk/models/shared/clientratelimitwebhookpayload.ts @@ -1,88 +1,102 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ClientRateLimitWebhookPayload + */ +export interface ClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * The date time in UTC when your daily quota is reset. + * @type {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; +} -export type ClientRateLimitWebhookPayload = { - /** - * The number of available requests per day. - */ - dailyQuota?: number | undefined; - /** - * Total number of requests remaining for your client. - */ - quotaRemaining?: number | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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 | undefined; -}; +/** + * Check if a given object implements the ClientRateLimitWebhookPayload interface. + */ +export function instanceOfClientRateLimitWebhookPayload(value: object): value is ClientRateLimitWebhookPayload { + return true; +} -/** @internal */ -export const ClientRateLimitWebhookPayload$inboundSchema: z.ZodType< - ClientRateLimitWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); -/** @internal */ -export type ClientRateLimitWebhookPayload$Outbound = { - dailyQuota?: number | undefined; - quotaRemaining?: number | undefined; - expiryDate?: string | undefined; -}; +export function ClientRateLimitWebhookPayloadFromJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadFromJSONTyped(json, false); +} -/** @internal */ -export const ClientRateLimitWebhookPayload$outboundSchema: z.ZodType< - ClientRateLimitWebhookPayload$Outbound, - z.ZodTypeDef, - ClientRateLimitWebhookPayload -> = z.object({ - dailyQuota: z.number().int().optional(), - quotaRemaining: z.number().int().optional(), - expiryDate: z.string().optional(), -}); +export function ClientRateLimitWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ClientRateLimitWebhookPayload { + if (json == null) { + return json; + } + return { + + 'dailyQuota': json['dailyQuota'] == null ? undefined : json['dailyQuota'], + 'quotaRemaining': json['quotaRemaining'] == null ? undefined : json['quotaRemaining'], + 'expiryDate': json['expiryDate'] == null ? undefined : json['expiryDate'], + }; +} -export function clientRateLimitWebhookPayloadToJSON( - clientRateLimitWebhookPayload: ClientRateLimitWebhookPayload, -): string { - return JSON.stringify( - ClientRateLimitWebhookPayload$outboundSchema.parse( - clientRateLimitWebhookPayload, - ), - ); +export function ClientRateLimitWebhookPayloadToJSON(json: any): ClientRateLimitWebhookPayload { + return ClientRateLimitWebhookPayloadToJSONTyped(json, false); } -export function clientRateLimitWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ClientRateLimitWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ClientRateLimitWebhookPayload' from JSON`, - ); + +export function ClientRateLimitWebhookPayloadToJSONTyped(value?: ClientRateLimitWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dailyQuota': value['dailyQuota'], + 'quotaRemaining': value['quotaRemaining'], + 'expiryDate': value['expiryDate'], + }; +} + + +export interface ClientRateLimitWebhookClientRateLimitWebhookPayload { + /** + * The number of available requests per day. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + dailyQuota?: number; + /** + * Total number of requests remaining for your client. + * @type {number} + * @memberof ClientRateLimitWebhookPayload + */ + quotaRemaining?: number; + /** + * The date time in UTC when your daily quota is reset. + * @type {string} + * @memberof ClientRateLimitWebhookPayload + */ + expiryDate?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/codatfile.ts b/sync-for-expenses/src/sdk/models/shared/codatfile.ts index 0bc3490e3..39ee97b39 100644 --- a/sync-for-expenses/src/sdk/models/shared/codatfile.ts +++ b/sync-for-expenses/src/sdk/models/shared/codatfile.ts @@ -1,35 +1,15 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; +/* tslint:disable */ +/* eslint-disable */ export type CodatFile = { - fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Uint8Array; -}; - -/** @internal */ -export type CodatFile$Outbound = { - fileName: string; - content: ReadableStream | Blob | ArrayBuffer | Uint8Array; + content: ReadableStream | Blob | ArrayBuffer | Uint8Array; + fileName: string; }; -/** @internal */ -export const CodatFile$outboundSchema: z.ZodType< - CodatFile$Outbound, - z.ZodTypeDef, - CodatFile -> = z.object({ - fileName: z.string(), - content: z.union([ - z.instanceof(ReadableStream), - z.instanceof(Blob), - z.instanceof(ArrayBuffer), - z.instanceof(Uint8Array), - ]), -}); +export function CodatFileFromJSON(json: any): CodatFile { + return json; +} -export function codatFileToJSON(codatFile: CodatFile): string { - return JSON.stringify(CodatFile$outboundSchema.parse(codatFile)); +export function CodatFileToJSON(value?: CodatFile | null): any { + return value; } diff --git a/sync-for-expenses/src/sdk/models/shared/companies.ts b/sync-for-expenses/src/sdk/models/shared/companies.ts index 0f308542e..abe3f07b4 100644 --- a/sync-for-expenses/src/sdk/models/shared/companies.ts +++ b/sync-for-expenses/src/sdk/models/shared/companies.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Company, Company$inboundSchema } from "./company.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Companies = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Companies$inboundSchema: z.ZodType< - Companies, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Company$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function companiesFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Companies$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Companies' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Company } from './company'; +import { + CompanyFromJSON, + CompanyFromJSONTyped, + CompanyToJSON, + CompanyToJSONTyped, +} from './company'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Companies + */ +export interface Companies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; +} + +/** + * Check if a given object implements the Companies interface. + */ +export function instanceOfCompanies(value: object): value is Companies { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function CompaniesFromJSON(json: any): Companies { + return CompaniesFromJSONTyped(json, false); +} + +export function CompaniesFromJSONTyped(json: any, ignoreDiscriminator: boolean): Companies { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(CompanyFromJSON)), + }; +} + +export function CompaniesToJSON(json: any): Companies { + return CompaniesToJSONTyped(json, false); +} + +export function CompaniesToJSONTyped(value?: Companies | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(CompanyToJSON)), + }; +} + + +export interface CompaniesListResponseCompanies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; +} + +export interface ListCompaniesResponseCompanies { + /** + * Current page number. + * @type {number} + * @memberof Companies + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Companies + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Companies + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Companies + */ + links: Links; + /** + * + * @type {Array} + * @memberof Companies + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/company.ts b/sync-for-expenses/src/sdk/models/shared/company.ts index adc722807..4f00a74c1 100644 --- a/sync-for-expenses/src/sdk/models/shared/company.ts +++ b/sync-for-expenses/src/sdk/models/shared/company.ts @@ -1,131 +1,1000 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CompanyReference } from './companyreference'; import { - CompanyReference, - CompanyReference$inboundSchema, -} from "./companyreference.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; /** - * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-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. - * - * @remarks - * + * In Codat, a company represents a business sharing access to their data. Each company can have multiple [connections](https://docs.codat.io/sync-for-expenses-api#/schemas/Connection) to different data sources such as one connection to [Xero](https://docs.codat.io/integrations/accounting/xero/accounting-xero) for accounting data, two connections to [Plaid](https://docs.codat.io/integrations/banking/plaid/banking-plaid) for two bank accounts and a connection to [Zettle](https://docs.codat.io/integrations/commerce/zettle/commerce-zettle) for POS data. + * * Typically each company is one of your customers. - * + * * When you create a company, you can specify a `name` and we will automatically generate a unique `id` for the company. You can also add a `description` to store any additional information about the company. + * @export + * @interface Company + */ +export interface Company { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +/** + * Check if a given object implements the Company interface. */ -export type Company = { - /** - * Unique identifier for your SMB in Codat. - */ - id: string; - /** - * The name of the company - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * 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; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - lastSync?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - created?: string | undefined; - /** - * Name of user that created the company in Codat. - */ - createdByUserName?: string | null | undefined; - /** - * An array of products that are currently enabled for the company. - */ - products?: Array | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; - referenceParentCompany?: CompanyReference | undefined; - /** - * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. - */ - referenceSubsidiaryCompanies?: Array | undefined; - dataConnections?: Array | undefined; -}; - -/** @internal */ -export const Company$inboundSchema: z.ZodType = - z.object({ - id: z.string(), - name: z.string(), - description: z.string().optional(), - redirect: z.string(), - lastSync: z.string().optional(), - created: z.string().optional(), - createdByUserName: z.nullable(z.string()).optional(), - products: z.array(z.string()).optional(), - tags: z.record(z.string()).optional(), - referenceParentCompany: CompanyReference$inboundSchema.optional(), - referenceSubsidiaryCompanies: z.array(CompanyReference$inboundSchema) - .optional(), - dataConnections: z.array(Connection$inboundSchema).optional(), - }); - -export function companyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Company$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Company' from JSON`, - ); +export function instanceOfCompany(value: object): value is Company { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('name' in value) || value['name'] === undefined) return false; + if (!('redirect' in value) || value['redirect'] === undefined) return false; + return true; +} + +export function CompanyFromJSON(json: any): Company { + return CompanyFromJSONTyped(json, false); +} + +export function CompanyFromJSONTyped(json: any, ignoreDiscriminator: boolean): Company { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'redirect': json['redirect'], + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'] == null ? undefined : json['created'], + 'createdByUserName': json['createdByUserName'] == null ? undefined : json['createdByUserName'], + 'products': json['products'] == null ? undefined : json['products'], + 'tags': json['tags'] == null ? undefined : json['tags'], + 'referenceParentCompany': json['referenceParentCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceParentCompany']), + 'referenceSubsidiaryCompanies': json['referenceSubsidiaryCompanies'] == null ? undefined : ((json['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceFromJSON)), + 'dataConnections': json['dataConnections'] == null ? undefined : ((json['dataConnections'] as Array).map(ConnectionFromJSON)), + }; +} + +export function CompanyToJSON(json: any): Company { + return CompanyToJSONTyped(json, false); +} + +export function CompanyToJSONTyped(value?: Company | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'redirect': value['redirect'], + 'lastSync': value['lastSync'], + 'created': value['created'], + 'createdByUserName': value['createdByUserName'], + 'products': value['products'], + 'tags': value['tags'], + 'referenceParentCompany': CompanyReferenceToJSON(value['referenceParentCompany']), + 'referenceSubsidiaryCompanies': value['referenceSubsidiaryCompanies'] == null ? undefined : ((value['referenceSubsidiaryCompanies'] as Array).map(CompanyReferenceToJSON)), + 'dataConnections': value['dataConnections'] == null ? undefined : ((value['dataConnections'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface CompaniesCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompaniesListResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyCreateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyGetResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyReplaceResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CompanyUpdateResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface CreateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface GetCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ListCompaniesResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface ReplaceCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; +} + +export interface UpdateCompanyResponseCompany { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof Company + */ + id: string; + /** + * The name of the company + * @type {string} + * @memberof Company + */ + name: string; + /** + * A description of the property. + * @type {string} + * @memberof Company + */ + description?: string; + /** + * 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. + * @type {string} + * @memberof Company + */ + redirect: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Company + */ + created?: string; + /** + * Name of user that created the company in Codat. + * @type {string} + * @memberof Company + */ + createdByUserName?: string | null; + /** + * An array of products that are currently enabled for the company. + * @type {Array} + * @memberof Company + */ + products?: Array; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof Company + */ + tags?: { [key: string]: string; }; + /** + * The parent entity or controlling organization of this company. Null if the company has no parent. + * @type {CompanyReference} + * @memberof Company + */ + referenceParentCompany?: CompanyReference; + /** + * A list of subsidiary companies owned or controlled by this entity. Empty if the company has no children. + * @type {Array} + * @memberof Company + */ + referenceSubsidiaryCompanies?: Array; + /** + * + * @type {Array} + * @memberof Company + */ + dataConnections?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/companyconfiguration.ts b/sync-for-expenses/src/sdk/models/shared/companyconfiguration.ts index c3de39ac9..11d531553 100644 --- a/sync-for-expenses/src/sdk/models/shared/companyconfiguration.ts +++ b/sync-for-expenses/src/sdk/models/shared/companyconfiguration.ts @@ -1,77 +1,253 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { BankAccountDetails } from './bankaccountdetails'; import { - BankAccountDetails, - BankAccountDetails$inboundSchema, - BankAccountDetails$Outbound, - BankAccountDetails$outboundSchema, -} from "./bankaccountdetails.js"; + BankAccountDetailsFromJSON, + BankAccountDetailsFromJSONTyped, + BankAccountDetailsToJSON, + BankAccountDetailsToJSONTyped, +} from './bankaccountdetails'; +import type { SupplierDetails } from './supplierdetails'; import { - CustomerDetails, - CustomerDetails$inboundSchema, - CustomerDetails$Outbound, - CustomerDetails$outboundSchema, -} from "./customerdetails.js"; + SupplierDetailsFromJSON, + SupplierDetailsFromJSONTyped, + SupplierDetailsToJSON, + SupplierDetailsToJSONTyped, +} from './supplierdetails'; +import type { CustomerDetails } from './customerdetails'; import { - SupplierDetails, - SupplierDetails$inboundSchema, - SupplierDetails$Outbound, - SupplierDetails$outboundSchema, -} from "./supplierdetails.js"; - -export type CompanyConfiguration = { - bankAccount: BankAccountDetails; - supplier: SupplierDetails; - customer: CustomerDetails; -}; - -/** @internal */ -export const CompanyConfiguration$inboundSchema: z.ZodType< - CompanyConfiguration, - z.ZodTypeDef, - unknown -> = z.object({ - bankAccount: BankAccountDetails$inboundSchema, - supplier: SupplierDetails$inboundSchema, - customer: CustomerDetails$inboundSchema, -}); -/** @internal */ -export type CompanyConfiguration$Outbound = { - bankAccount: BankAccountDetails$Outbound; - supplier: SupplierDetails$Outbound; - customer: CustomerDetails$Outbound; -}; - -/** @internal */ -export const CompanyConfiguration$outboundSchema: z.ZodType< - CompanyConfiguration$Outbound, - z.ZodTypeDef, - CompanyConfiguration -> = z.object({ - bankAccount: BankAccountDetails$outboundSchema, - supplier: SupplierDetails$outboundSchema, - customer: CustomerDetails$outboundSchema, -}); - -export function companyConfigurationToJSON( - companyConfiguration: CompanyConfiguration, -): string { - return JSON.stringify( - CompanyConfiguration$outboundSchema.parse(companyConfiguration), - ); + CustomerDetailsFromJSON, + CustomerDetailsFromJSONTyped, + CustomerDetailsToJSON, + CustomerDetailsToJSONTyped, +} from './customerdetails'; + +/** + * + * @export + * @interface CompanyConfiguration + */ +export interface CompanyConfiguration { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +/** + * Check if a given object implements the CompanyConfiguration interface. + */ +export function instanceOfCompanyConfiguration(value: object): value is CompanyConfiguration { + if (!('bankAccount' in value) || value['bankAccount'] === undefined) return false; + if (!('supplier' in value) || value['supplier'] === undefined) return false; + if (!('customer' in value) || value['customer'] === undefined) return false; + return true; +} + +export function CompanyConfigurationFromJSON(json: any): CompanyConfiguration { + return CompanyConfigurationFromJSONTyped(json, false); +} + +export function CompanyConfigurationFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyConfiguration { + if (json == null) { + return json; + } + return { + + 'bankAccount': BankAccountDetailsFromJSON(json['bankAccount']), + 'supplier': SupplierDetailsFromJSON(json['supplier']), + 'customer': CustomerDetailsFromJSON(json['customer']), + }; +} + +export function CompanyConfigurationToJSON(json: any): CompanyConfiguration { + return CompanyConfigurationToJSONTyped(json, false); +} + +export function CompanyConfigurationToJSONTyped(value?: CompanyConfiguration | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'bankAccount': BankAccountDetailsToJSON(value['bankAccount']), + 'supplier': SupplierDetailsToJSON(value['supplier']), + 'customer': CustomerDetailsToJSON(value['customer']), + }; } -export function companyConfigurationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyConfiguration$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyConfiguration' from JSON`, - ); + + +export interface CompanyConfigurationGetResponseCompanyConfiguration { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +export interface CompanyConfigurationSetRequestBody { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +export interface CompanyConfigurationSetResponseCompanyConfiguration { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +export interface GetCompanyConfigurationResponseCompanyConfiguration { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +export interface SetCompanyConfigurationCompanyConfiguration { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +export interface SetCompanyConfigurationRequestBody { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; +} + +export interface SetCompanyConfigurationResponseCompanyConfiguration { + /** + * + * @type {BankAccountDetails} + * @memberof CompanyConfiguration + */ + bankAccount: BankAccountDetails; + /** + * + * @type {SupplierDetails} + * @memberof CompanyConfiguration + */ + supplier: SupplierDetails; + /** + * + * @type {CustomerDetails} + * @memberof CompanyConfiguration + */ + customer: CustomerDetails; } diff --git a/sync-for-expenses/src/sdk/models/shared/companyinformation.ts b/sync-for-expenses/src/sdk/models/shared/companyinformation.ts index 624491b9f..f499ed059 100644 --- a/sync-for-expenses/src/sdk/models/shared/companyinformation.ts +++ b/sync-for-expenses/src/sdk/models/shared/companyinformation.ts @@ -1,336 +1,739 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { Phone } from './phonenumberitems'; +import { mapValues } from '../../../runtime'; +import type { Weblink } from './weblink'; import { - AccountingAddressType, - AccountingAddressType$inboundSchema, -} from "./accountingaddresstype.js"; + WeblinkFromJSON, + WeblinkFromJSONTyped, + WeblinkToJSON, + WeblinkToJSONTyped, +} from './weblink'; +import type { SupplementalData } from './supplementaldata'; import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; - -export type AccountingAddress = { - /** - * The type of the address - */ - type: AccountingAddressType; - /** - * Line 1 of the customer address. - */ - line1?: string | null | undefined; - /** - * Line 2 of the customer address. - */ - line2?: string | null | undefined; - /** - * City of the customer address. - */ - city?: string | null | undefined; - /** - * Region of the customer address. - */ - region?: string | null | undefined; - /** - * Country of the customer address. - */ - country?: string | null | undefined; - /** - * Postal code or zip code. - */ - postalCode?: string | null | undefined; -}; - -/** - * The type of phone number - */ -export const CompanyInformationPhoneNumbersType = { - Primary: "Primary", - Landline: "Landline", - Mobile: "Mobile", - Fax: "Fax", - Unknown: "Unknown", -} as const; -/** - * The type of phone number - */ -export type CompanyInformationPhoneNumbersType = ClosedEnum< - typeof CompanyInformationPhoneNumbersType ->; - -export type Phone = { - /** - * A phone number. - */ - number?: string | null | undefined; - /** - * The type of phone number - */ - type: CompanyInformationPhoneNumbersType; -}; + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './supplementaldata'; +import type { AccountingAddress } from './accountingaddress'; +import { + AccountingAddressFromJSON, + AccountingAddressFromJSONTyped, + AccountingAddressToJSON, + AccountingAddressToJSONTyped, +} from './accountingaddress'; +import type { PhoneNumberItems } from './phonenumberitems'; +import { + PhoneNumberItemsFromJSON, + PhoneNumberItemsFromJSONTyped, + PhoneNumberItemsToJSON, + PhoneNumberItemsToJSONTyped, +} from './phonenumberitems'; /** - * The type of the weblink. - */ -export const CompanyInformationType = { - Website: "Website", - Social: "Social", - Unknown: "Unknown", -} as const; -/** - * The type of the weblink. + * Company info provides standard details about a linked company such as their address, phone number, and company registration. + * + * > **Company information or companies?** + * > + * > Company information 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. + * @export + * @interface CompanyInformation */ -export type CompanyInformationType = ClosedEnum; +export interface CompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; +} /** - * Weblink associated with the company. + * Check if a given object implements the CompanyInformation interface. */ -export type Weblink = { - /** - * The type of the weblink. - */ - type?: CompanyInformationType | undefined; - /** - * The full URL for the weblink. - */ - url?: string | undefined; -}; +export function instanceOfCompanyInformation(value: object): value is CompanyInformation { + return true; +} -/** - * Company info provides standard details about a linked company such as their address, phone number, and company registration. - * - * @remarks - * - * > **Company information or companies?** - * > - * > Company information 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. - */ -export type CompanyInformation = { - /** - * Name of the linked company. - */ - companyName?: string | null | undefined; - /** - * Identifier or reference for the company in the accounting software. - */ - accountingPlatformRef?: string | null | undefined; - /** - * Registered legal name of the linked company. - */ - companyLegalName?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * An array of phone numbers. - */ - phoneNumbers?: Array | null | undefined; - /** - * An array of weblinks. - */ - webLinks?: Array | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - ledgerLockDate?: string | undefined; - /** - * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. - */ - registrationNumber?: string | null | undefined; - /** - * Company tax number. - */ - taxNumber?: string | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - financialYearStartDate?: string | undefined; - /** - * Currency set in the accounting software of the linked company. Used by the currency rate. - */ - baseCurrency?: string | null | undefined; - /** - * URL addresses for the accounting source. - * - * @remarks - * - * 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). - */ - sourceUrls?: { [k: string]: string | null } | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - createdDate?: string | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; +export function CompanyInformationFromJSON(json: any): CompanyInformation { + return CompanyInformationFromJSONTyped(json, false); +} -/** @internal */ -export const AccountingAddress$inboundSchema: z.ZodType< - AccountingAddress, - z.ZodTypeDef, - unknown -> = z.object({ - type: AccountingAddressType$inboundSchema, - line1: z.nullable(z.string()).optional(), - line2: z.nullable(z.string()).optional(), - city: z.nullable(z.string()).optional(), - region: z.nullable(z.string()).optional(), - country: z.nullable(z.string()).optional(), - postalCode: z.nullable(z.string()).optional(), -}); +export function CompanyInformationFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyInformation { + if (json == null) { + return json; + } + return { + + 'companyName': json['companyName'] == null ? undefined : json['companyName'], + 'accountingPlatformRef': json['accountingPlatformRef'] == null ? undefined : json['accountingPlatformRef'], + 'companyLegalName': json['companyLegalName'] == null ? undefined : json['companyLegalName'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(AccountingAddressFromJSON)), + 'phoneNumbers': json['phoneNumbers'] == null ? undefined : ((json['phoneNumbers'] as Array).map(PhoneNumberItemsFromJSON)), + 'webLinks': json['webLinks'] == null ? undefined : ((json['webLinks'] as Array).map(WeblinkFromJSON)), + 'ledgerLockDate': json['ledgerLockDate'] == null ? undefined : json['ledgerLockDate'], + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'financialYearStartDate': json['financialYearStartDate'] == null ? undefined : json['financialYearStartDate'], + 'baseCurrency': json['baseCurrency'] == null ? undefined : json['baseCurrency'], + 'sourceUrls': json['sourceUrls'] == null ? undefined : json['sourceUrls'], + 'createdDate': json['createdDate'] == null ? undefined : json['createdDate'], + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + }; +} -export function accountingAddressFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountingAddress$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountingAddress' from JSON`, - ); +export function CompanyInformationToJSON(json: any): CompanyInformation { + return CompanyInformationToJSONTyped(json, false); } -/** @internal */ -export const CompanyInformationPhoneNumbersType$inboundSchema: z.ZodNativeEnum< - typeof CompanyInformationPhoneNumbersType -> = z.nativeEnum(CompanyInformationPhoneNumbersType); +export function CompanyInformationToJSONTyped(value?: CompanyInformation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'companyName': value['companyName'], + 'accountingPlatformRef': value['accountingPlatformRef'], + 'companyLegalName': value['companyLegalName'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(AccountingAddressToJSON)), + 'phoneNumbers': value['phoneNumbers'] == null ? undefined : ((value['phoneNumbers'] as Array).map(PhoneNumberItemsToJSON)), + 'webLinks': value['webLinks'] == null ? undefined : ((value['webLinks'] as Array).map(WeblinkToJSON)), + 'ledgerLockDate': value['ledgerLockDate'], + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'financialYearStartDate': value['financialYearStartDate'], + 'baseCurrency': value['baseCurrency'], + 'sourceUrls': value['sourceUrls'], + 'createdDate': value['createdDate'], + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + }; +} -/** @internal */ -export const Phone$inboundSchema: z.ZodType = z - .object({ - number: z.nullable(z.string()).optional(), - type: CompanyInformationPhoneNumbersType$inboundSchema, - }); -export function phoneFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Phone$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Phone' from JSON`, - ); +export interface AccountingCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; } -/** @internal */ -export const CompanyInformationType$inboundSchema: z.ZodNativeEnum< - typeof CompanyInformationType -> = z.nativeEnum(CompanyInformationType); +export interface CompanyInfoGetResponseAccountingCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; +} -/** @internal */ -export const Weblink$inboundSchema: z.ZodType = - z.object({ - type: CompanyInformationType$inboundSchema.optional(), - url: z.string().optional(), - }); +export interface CompanyInfoGetResponseCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; +} -export function weblinkFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Weblink$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Weblink' from JSON`, - ); +export interface CompanyInformationAccountingCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; } -/** @internal */ -export const CompanyInformation$inboundSchema: z.ZodType< - CompanyInformation, - z.ZodTypeDef, - unknown -> = z.object({ - companyName: z.nullable(z.string()).optional(), - accountingPlatformRef: z.nullable(z.string()).optional(), - companyLegalName: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(z.lazy(() => AccountingAddress$inboundSchema))) - .optional(), - phoneNumbers: z.nullable(z.array(z.lazy(() => Phone$inboundSchema))) - .optional(), - webLinks: z.nullable(z.array(z.lazy(() => Weblink$inboundSchema))).optional(), - ledgerLockDate: z.string().optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - financialYearStartDate: z.string().optional(), - baseCurrency: z.nullable(z.string()).optional(), - sourceUrls: z.nullable(z.record(z.nullable(z.string()))).optional(), - createdDate: z.string().optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); +export interface GetCompanyInfoResponseAccountingCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; +} -export function companyInformationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyInformation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyInformation' from JSON`, - ); +export interface GetCompanyInfoResponseCompanyInformation { + /** + * Name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyName?: string | null; + /** + * Identifier or reference for the company in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + accountingPlatformRef?: string | null; + /** + * Registered legal name of the linked company. + * @type {string} + * @memberof CompanyInformation + */ + companyLegalName?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof CompanyInformation + */ + addresses?: Array | null; + /** + * An array of phone numbers. + * @type {Array} + * @memberof CompanyInformation + */ + phoneNumbers?: Array | null; + /** + * An array of weblinks. + * @type {Array} + * @memberof CompanyInformation + */ + webLinks?: Array | null; + /** + * If set in the accounting software, the date (in the ISO 8601 date/time format) after which accounting transactions cannot be edited. Commonly used when books are closed at year-end. + * @type {string} + * @memberof CompanyInformation + */ + ledgerLockDate?: string; + /** + * Registration number given to the linked company by the companies authority in the country of origin. In the UK this is Companies House. + * @type {string} + * @memberof CompanyInformation + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof CompanyInformation + */ + taxNumber?: string | null; + /** + * Start date of the financial year for the company. + * @type {string} + * @memberof CompanyInformation + */ + financialYearStartDate?: string; + /** + * Currency set in the accounting software of the linked company. Used by the currency rate. + * @type {string} + * @memberof CompanyInformation + */ + baseCurrency?: string | null; + /** + * 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). + * @type {{ [key: string]: string; }} + * @memberof CompanyInformation + */ + sourceUrls?: { [key: string]: string | null; } | null; + /** + * Date the linked company was created in the accounting software. + * @type {string} + * @memberof CompanyInformation + */ + createdDate?: string; + /** + * + * @type {SupplementalData} + * @memberof CompanyInformation + */ + supplementalData?: SupplementalData; } diff --git a/sync-for-expenses/src/sdk/models/shared/companyreference.ts b/sync-for-expenses/src/sdk/models/shared/companyreference.ts index e40af5e26..488872c73 100644 --- a/sync-for-expenses/src/sdk/models/shared/companyreference.ts +++ b/sync-for-expenses/src/sdk/models/shared/companyreference.ts @@ -1,131 +1,468 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CompanyReferenceLinks } from './companyreferencelinks'; +import { + CompanyReferenceLinksFromJSON, + CompanyReferenceLinksFromJSONTyped, + CompanyReferenceLinksToJSON, + CompanyReferenceLinksToJSONTyped, +} from './companyreferencelinks'; + +/** + * + * @export + * @interface CompanyReference + */ +export interface CompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} /** - * A collection of links for the company. + * Check if a given object implements the CompanyReference interface. */ -export type CompanyReferenceLinks = { - /** - * Link to the company page in the portal. - */ - portal?: string | undefined; -}; - -export type CompanyReference = { - /** - * Unique identifier for your SMB in Codat. - */ - id?: string | undefined; - /** - * The name of the company - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of links for the company. - */ - links?: CompanyReferenceLinks | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$inboundSchema: z.ZodType< - CompanyReferenceLinks, - z.ZodTypeDef, - unknown -> = z.object({ - portal: z.string().optional(), -}); -/** @internal */ -export type CompanyReferenceLinks$Outbound = { - portal?: string | undefined; -}; - -/** @internal */ -export const CompanyReferenceLinks$outboundSchema: z.ZodType< - CompanyReferenceLinks$Outbound, - z.ZodTypeDef, - CompanyReferenceLinks -> = z.object({ - portal: z.string().optional(), -}); - -export function companyReferenceLinksToJSON( - companyReferenceLinks: CompanyReferenceLinks, -): string { - return JSON.stringify( - CompanyReferenceLinks$outboundSchema.parse(companyReferenceLinks), - ); -} -export function companyReferenceLinksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyReferenceLinks$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReferenceLinks' from JSON`, - ); -} - -/** @internal */ -export const CompanyReference$inboundSchema: z.ZodType< - CompanyReference, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - links: z.lazy(() => CompanyReferenceLinks$inboundSchema).optional(), - tags: z.record(z.string()).optional(), -}); -/** @internal */ -export type CompanyReference$Outbound = { - id?: string | undefined; - name?: string | undefined; - description?: string | undefined; - links?: CompanyReferenceLinks$Outbound | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyReference$outboundSchema: z.ZodType< - CompanyReference$Outbound, - z.ZodTypeDef, - CompanyReference -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - description: z.string().optional(), - links: z.lazy(() => CompanyReferenceLinks$outboundSchema).optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyReferenceToJSON( - companyReference: CompanyReference, -): string { - return JSON.stringify( - CompanyReference$outboundSchema.parse(companyReference), - ); -} -export function companyReferenceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanyReference$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanyReference' from JSON`, - ); +export function instanceOfCompanyReference(value: object): value is CompanyReference { + return true; +} + +export function CompanyReferenceFromJSON(json: any): CompanyReference { + return CompanyReferenceFromJSONTyped(json, false); +} + +export function CompanyReferenceFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReference { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'links': json['links'] == null ? undefined : CompanyReferenceLinksFromJSON(json['links']), + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyReferenceToJSON(json: any): CompanyReference { + return CompanyReferenceToJSONTyped(json, false); +} + +export function CompanyReferenceToJSONTyped(value?: CompanyReference | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'name': value['name'], + 'description': value['description'], + 'links': CompanyReferenceLinksToJSON(value['links']), + 'tags': value['tags'], + }; +} + + +export interface CompaniesCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyCreateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyGetResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyUpdateResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ExpensesSyncWebhookCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface GetCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyResponseCompanyReference { + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanyReference + */ + id?: string; + /** + * The name of the company + * @type {string} + * @memberof CompanyReference + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyReference + */ + description?: string; + /** + * + * @type {CompanyReferenceLinks} + * @memberof CompanyReference + */ + links?: CompanyReferenceLinks; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyReference + */ + tags?: { [key: string]: string; }; } diff --git a/sync-for-expenses/src/sdk/models/shared/companyreferencelinks.ts b/sync-for-expenses/src/sdk/models/shared/companyreferencelinks.ts new file mode 100644 index 000000000..3803a2e8e --- /dev/null +++ b/sync-for-expenses/src/sdk/models/shared/companyreferencelinks.ts @@ -0,0 +1,155 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * A collection of links for the company. + * @export + * @interface CompanyReferenceLinks + */ +export interface CompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +/** + * Check if a given object implements the CompanyReferenceLinks interface. + */ +export function instanceOfCompanyReferenceLinks(value: object): value is CompanyReferenceLinks { + return true; +} + +export function CompanyReferenceLinksFromJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksFromJSONTyped(json, false); +} + +export function CompanyReferenceLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyReferenceLinks { + if (json == null) { + return json; + } + return { + + 'portal': json['portal'] == null ? undefined : json['portal'], + }; +} + +export function CompanyReferenceLinksToJSON(json: any): CompanyReferenceLinks { + return CompanyReferenceLinksToJSONTyped(json, false); +} + +export function CompanyReferenceLinksToJSONTyped(value?: CompanyReferenceLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'portal': value['portal'], + }; +} + + +export interface CompanyCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyCreateResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyGetResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyReplaceResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CompanyUpdateResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface CreateCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface ExpensesSyncWebhookCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface GetCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface ReplaceCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} + +export interface UpdateCompanyResponseCompanyReferenceLinks { + /** + * Link to the company page in the portal. + * @type {string} + * @memberof CompanyReferenceLinks + */ + portal?: string; +} diff --git a/sync-for-expenses/src/sdk/models/shared/companyrequestbody.ts b/sync-for-expenses/src/sdk/models/shared/companyrequestbody.ts index 5e438635a..d2b1480f9 100644 --- a/sync-for-expenses/src/sdk/models/shared/companyrequestbody.ts +++ b/sync-for-expenses/src/sdk/models/shared/companyrequestbody.ts @@ -1,46 +1,208 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyRequestBody = { - /** - * Name of company being connected. - */ - name: string; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyRequestBody$Outbound = { - name: string; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyRequestBody$outboundSchema: z.ZodType< - CompanyRequestBody$Outbound, - z.ZodTypeDef, - CompanyRequestBody -> = z.object({ - name: z.string(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyRequestBodyToJSON( - companyRequestBody: CompanyRequestBody, -): string { - return JSON.stringify( - CompanyRequestBody$outboundSchema.parse(companyRequestBody), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyRequestBody + */ +export interface CompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyRequestBody interface. + */ +export function instanceOfCompanyRequestBody(value: object): value is CompanyRequestBody { + if (!('name' in value) || value['name'] === undefined) return false; + return true; +} + +export function CompanyRequestBodyFromJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyFromJSONTyped(json, false); +} + +export function CompanyRequestBodyFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyRequestBody { + if (json == null) { + return json; + } + return { + + 'name': json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyRequestBodyToJSON(json: any): CompanyRequestBody { + return CompanyRequestBodyToJSONTyped(json, false); +} + +export function CompanyRequestBodyToJSONTyped(value?: CompanyRequestBody | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyCreateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CompanyReplaceRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface CreateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; +} + +export interface ReplaceCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyRequestBody + */ + name: string; + /** + * Additional information about the company. This can be used to store foreign IDs, references, etc. + * @type {string} + * @memberof CompanyRequestBody + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyRequestBody + */ + tags?: { [key: string]: string; }; } diff --git a/sync-for-expenses/src/sdk/models/shared/companysyncstatus.ts b/sync-for-expenses/src/sdk/models/shared/companysyncstatus.ts index 72e7076d3..64abedfae 100644 --- a/sync-for-expenses/src/sdk/models/shared/companysyncstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/companysyncstatus.ts @@ -1,87 +1,540 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CompanySyncStatus = { - /** - * Unique identifier for your SMB in Codat. - */ - companyId?: string | null | undefined; - /** - * Unique identifier of the sync. - */ - syncId?: string | null | undefined; - /** - * Status code of the sync. - */ - syncStatusCode?: number | undefined; - /** - * Text status of the sync. - */ - syncStatus?: string | null | undefined; - /** - * Error message of the sync. - */ - errorMessage?: string | null | undefined; - /** - * Exception message of the sync. - */ - syncExceptionMessage?: string | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - syncUtc?: string | undefined; - /** - * Boolean of whether the sync resulted in data being pushed. - */ - dataPushed?: boolean | undefined; -}; - -/** @internal */ -export const CompanySyncStatus$inboundSchema: z.ZodType< - CompanySyncStatus, - z.ZodTypeDef, - unknown -> = z.object({ - companyId: z.nullable(z.string()).optional(), - syncId: z.nullable(z.string()).optional(), - syncStatusCode: z.number().int().optional(), - syncStatus: z.nullable(z.string()).optional(), - errorMessage: z.nullable(z.string()).optional(), - syncExceptionMessage: z.nullable(z.string()).optional(), - syncUtc: z.string().optional(), - dataPushed: z.boolean().optional(), -}); - -export function companySyncStatusFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CompanySyncStatus$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CompanySyncStatus' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanySyncStatus + */ +export interface CompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +/** + * Check if a given object implements the CompanySyncStatus interface. + */ +export function instanceOfCompanySyncStatus(value: object): value is CompanySyncStatus { + return true; +} + +export function CompanySyncStatusFromJSON(json: any): CompanySyncStatus { + return CompanySyncStatusFromJSONTyped(json, false); +} + +export function CompanySyncStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanySyncStatus { + if (json == null) { + return json; + } + return { + + ...json, + 'companyId': json['companyId'] == null ? undefined : json['companyId'], + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + 'syncStatusCode': json['syncStatusCode'] == null ? undefined : json['syncStatusCode'], + 'syncStatus': json['syncStatus'] == null ? undefined : json['syncStatus'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'syncExceptionMessage': json['syncExceptionMessage'] == null ? undefined : json['syncExceptionMessage'], + 'syncUtc': json['syncUtc'] == null ? undefined : json['syncUtc'], + 'dataPushed': json['dataPushed'] == null ? undefined : json['dataPushed'], + }; +} + +export function CompanySyncStatusToJSON(json: any): CompanySyncStatus { + return CompanySyncStatusToJSONTyped(json, false); +} + +export function CompanySyncStatusToJSONTyped(value?: CompanySyncStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'companyId': value['companyId'], + 'syncId': value['syncId'], + 'syncStatusCode': value['syncStatusCode'], + 'syncStatus': value['syncStatus'], + 'errorMessage': value['errorMessage'], + 'syncExceptionMessage': value['syncExceptionMessage'], + 'syncUtc': value['syncUtc'], + 'dataPushed': value['dataPushed'], + }; +} + + +export interface GetLastSuccessfulSyncResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface GetLatestSyncResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface GetSyncByIdResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface LastSuccessfulSyncGetResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface LatestSyncGetResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface ListSyncsResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface SyncByIdGetResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; +} + +export interface SyncsListResponseCompanySyncStatus { + [key: string]: any | any; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CompanySyncStatus + */ + companyId?: string | null; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncId?: string | null; + /** + * Status code of the sync. + * @type {number} + * @memberof CompanySyncStatus + */ + syncStatusCode?: number; + /** + * Text status of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncStatus?: string | null; + /** + * Error message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + errorMessage?: string | null; + /** + * Exception message of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncExceptionMessage?: string | null; + /** + * Datetime of the sync. + * @type {string} + * @memberof CompanySyncStatus + */ + syncUtc?: string | null; + /** + * Boolean of whether the sync resulted in data being pushed. + * @type {boolean} + * @memberof CompanySyncStatus + */ + dataPushed?: boolean; } diff --git a/sync-for-expenses/src/sdk/models/shared/companyupdaterequest.ts b/sync-for-expenses/src/sdk/models/shared/companyupdaterequest.ts index 442b7a78c..e095027d0 100644 --- a/sync-for-expenses/src/sdk/models/shared/companyupdaterequest.ts +++ b/sync-for-expenses/src/sdk/models/shared/companyupdaterequest.ts @@ -1,46 +1,144 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type CompanyUpdateRequest = { - /** - * Name of company being connected. - */ - name?: string | undefined; - /** - * Additional information about the company. This can be used to store foreign IDs, references, etc. - */ - description?: string | undefined; - /** - * A collection of user-defined key-value pairs that store custom metadata against the company. - */ - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export type CompanyUpdateRequest$Outbound = { - name?: string | undefined; - description?: string | undefined; - tags?: { [k: string]: string } | undefined; -}; - -/** @internal */ -export const CompanyUpdateRequest$outboundSchema: z.ZodType< - CompanyUpdateRequest$Outbound, - z.ZodTypeDef, - CompanyUpdateRequest -> = z.object({ - name: z.string().optional(), - description: z.string().optional(), - tags: z.record(z.string()).optional(), -}); - -export function companyUpdateRequestToJSON( - companyUpdateRequest: CompanyUpdateRequest, -): string { - return JSON.stringify( - CompanyUpdateRequest$outboundSchema.parse(companyUpdateRequest), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CompanyUpdateRequest + */ +export interface CompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +/** + * Check if a given object implements the CompanyUpdateRequest interface. + */ +export function instanceOfCompanyUpdateRequest(value: object): value is CompanyUpdateRequest { + return true; +} + +export function CompanyUpdateRequestFromJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestFromJSONTyped(json, false); +} + +export function CompanyUpdateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CompanyUpdateRequest { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'description': json['description'] == null ? undefined : json['description'], + 'tags': json['tags'] == null ? undefined : json['tags'], + }; +} + +export function CompanyUpdateRequestToJSON(json: any): CompanyUpdateRequest { + return CompanyUpdateRequestToJSONTyped(json, false); +} + +export function CompanyUpdateRequestToJSONTyped(value?: CompanyUpdateRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'description': value['description'], + 'tags': value['tags'], + }; +} + + +export interface CompanyUpdateRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyCompanyUpdateRequest { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; +} + +export interface UpdateCompanyRequestBody { + /** + * Name of company being connected. + * @type {string} + * @memberof CompanyUpdateRequest + */ + name?: string; + /** + * A description of the property. + * @type {string} + * @memberof CompanyUpdateRequest + */ + description?: string; + /** + * A collection of user-defined key-value pairs that store custom metadata against the company. + * @type {{ [key: string]: string; }} + * @memberof CompanyUpdateRequest + */ + tags?: { [key: string]: string; }; } diff --git a/sync-for-expenses/src/sdk/models/shared/connection.ts b/sync-for-expenses/src/sdk/models/shared/connection.ts index cc4e99380..b45519394 100644 --- a/sync-for-expenses/src/sdk/models/shared/connection.ts +++ b/sync-for-expenses/src/sdk/models/shared/connection.ts @@ -1,164 +1,1725 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { SourceType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import type { DataConnectionStatus } from './dataconnectionstatus'; import { - DataConnectionError, - DataConnectionError$inboundSchema, -} from "./dataconnectionerror.js"; + DataConnectionStatusFromJSON, + DataConnectionStatusFromJSONTyped, + DataConnectionStatusToJSON, + DataConnectionStatusToJSONTyped, +} from './dataconnectionstatus'; +import type { DataConnectionError } from './dataconnectionerror'; import { - DataConnectionStatus, - DataConnectionStatus$inboundSchema, -} from "./dataconnectionstatus.js"; - -/** - * The type of platform of the connection. - */ -export const SourceType = { - Accounting: "Accounting", - Banking: "Banking", - BankFeed: "BankFeed", - Commerce: "Commerce", - Expense: "Expense", - Other: "Other", - Unknown: "Unknown", -} as const; -/** - * The type of platform of the connection. - */ -export type SourceType = ClosedEnum; + DataConnectionErrorFromJSON, + DataConnectionErrorFromJSONTyped, + DataConnectionErrorToJSON, + DataConnectionErrorToJSONTyped, +} from './dataconnectionerror'; /** - * A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. - * - * @remarks - * + * A connection represents a [company's](https://docs.codat.io/sync-for-expenses-api#/schemas/Company) connection to a data source and allows you to synchronize data (pull and/or push) with that source. + * * A company can have multiple data connections depending on the type of data source it is connecting to. For example, a single company can link to: - * + * * - [Accounting data](https://docs.codat.io/accounting-api/overview) - 1 active connection. * - [Banking data](https://docs.codat.io/banking-api/overview) - Multiple active connections. * - [Commerce data](https://docs.codat.io/commerce-api/overview) - Multiple active connections. * Any combination of accounting, banking, and commerce data connections is allowed. - * + * * Before you can use a data connection to pull or push data, the company must grant you access to their business data by [linking the connection](https://docs.codat.io/auth-flow/overview). + * @export + * @interface Connection */ -export type Connection = { - /** - * Unique identifier for a company's data connection. - */ - id: string; - /** - * A Codat ID representing the integration. - */ - integrationId: string; - /** - * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. - */ - integrationKey?: string | undefined; - /** - * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. - */ - sourceId: string; - /** - * The type of platform of the connection. - */ - sourceType: SourceType; - /** - * Name of integration connected to company. - */ - platformName: string; - /** - * The link URL your customers can use to authorize access to their business application. - */ - linkUrl: string; - /** - * The current authorization status of the data connection. - */ - status: DataConnectionStatus; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - lastSync?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - created: string; - dataConnectionErrors?: Array | null | undefined; - connectionInfo?: { [k: string]: any } | null | undefined; -}; - -/** @internal */ -export const SourceType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(SourceType); - -/** @internal */ -export const Connection$inboundSchema: z.ZodType< - Connection, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - integrationId: z.string(), - integrationKey: z.string().optional(), - sourceId: z.string(), - sourceType: SourceType$inboundSchema, - platformName: z.string(), - linkUrl: z.string(), - status: DataConnectionStatus$inboundSchema, - lastSync: z.string().optional(), - created: z.string(), - dataConnectionErrors: z.nullable(z.array(DataConnectionError$inboundSchema)) - .optional(), - connectionInfo: z.nullable(z.record(z.any())).optional(), -}); - -export function connectionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connection$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connection' from JSON`, - ); +export interface Connection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + + +/** + * @export + */ +export const ConnectionSourceTypeEnum = { + Accounting: 'Accounting', + Banking: 'Banking', + BankFeed: 'BankFeed', + Commerce: 'Commerce', + Expense: 'Expense', + Other: 'Other', + Unknown: 'Unknown' +} as const; +export type ConnectionSourceTypeEnum = typeof ConnectionSourceTypeEnum[keyof typeof ConnectionSourceTypeEnum]; + + +/** + * Check if a given object implements the Connection interface. + */ +export function instanceOfConnection(value: object): value is Connection { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('integrationId' in value) || value['integrationId'] === undefined) return false; + if (!('sourceId' in value) || value['sourceId'] === undefined) return false; + if (!('sourceType' in value) || value['sourceType'] === undefined) return false; + if (!('platformName' in value) || value['platformName'] === undefined) return false; + if (!('linkUrl' in value) || value['linkUrl'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('created' in value) || value['created'] === undefined) return false; + return true; +} + +export function ConnectionFromJSON(json: any): Connection { + return ConnectionFromJSONTyped(json, false); +} + +export function ConnectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connection { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'], + 'integrationId': json['integrationId'], + 'integrationKey': json['integrationKey'] == null ? undefined : json['integrationKey'], + 'sourceId': json['sourceId'], + 'sourceType': json['sourceType'], + 'platformName': json['platformName'], + 'linkUrl': json['linkUrl'], + 'status': DataConnectionStatusFromJSON(json['status']), + 'lastSync': json['lastSync'] == null ? undefined : json['lastSync'], + 'created': json['created'], + 'dataConnectionErrors': json['dataConnectionErrors'] == null ? undefined : ((json['dataConnectionErrors'] as Array).map(DataConnectionErrorFromJSON)), + 'connectionInfo': json['connectionInfo'] == null ? undefined : json['connectionInfo'], + }; +} + +export function ConnectionToJSON(json: any): Connection { + return ConnectionToJSONTyped(json, false); +} + +export function ConnectionToJSONTyped(value?: Connection | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'integrationId': value['integrationId'], + 'integrationKey': value['integrationKey'], + 'sourceId': value['sourceId'], + 'sourceType': value['sourceType'], + 'platformName': value['platformName'], + 'linkUrl': value['linkUrl'], + 'status': DataConnectionStatusToJSON(value['status']), + 'lastSync': value['lastSync'], + 'created': value['created'], + 'dataConnectionErrors': value['dataConnectionErrors'] == null ? undefined : ((value['dataConnectionErrors'] as Array).map(DataConnectionErrorToJSON)), + 'connectionInfo': value['connectionInfo'], + }; +} + + +export interface CompanyConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyReplaceResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CompanyUpdateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionGetResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionUnlinkResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ConnectionsListResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreateConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface CreatePartnerExpenseConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface GetConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ListConnectionsResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface PartnerExpenseConnectionCreateResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface ReplaceCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UnlinkConnectionResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; +} + +export interface UpdateCompanyResponseConnection { + [key: string]: any | any; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof Connection + */ + id: string; + /** + * A Codat ID representing the integration. + * @type {string} + * @memberof Connection + */ + integrationId: string; + /** + * A unique four-character ID that identifies the platform of the company's data connection. This ensures continuity if the platform changes its name in the future. + * @type {string} + * @memberof Connection + */ + integrationKey?: string; + /** + * A source-specific ID used to distinguish between different sources originating from the same data connection. In general, a data connection is a single data source. However, for TrueLayer, `sourceId` is associated with a specific bank and has a many-to-one relationship with the `integrationId`. + * @type {string} + * @memberof Connection + */ + sourceId: string; + /** + * The type of platform of the connection. + * @type {string} + * @memberof Connection + */ + sourceType: SourceType; + /** + * Name of integration connected to company. + * @type {string} + * @memberof Connection + */ + platformName: string; + /** + * The link URL your customers can use to authorize access to their business application. + * @type {string} + * @memberof Connection + */ + linkUrl: string; + /** + * + * @type {DataConnectionStatus} + * @memberof Connection + */ + status: DataConnectionStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + lastSync?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Connection + */ + created: string; + /** + * + * @type {Array} + * @memberof Connection + */ + dataConnectionErrors?: Array | null; + /** + * + * @type {{ [key: string]: any; }} + * @memberof Connection + */ + connectionInfo?: { [key: string]: any; } | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/connections.ts b/sync-for-expenses/src/sdk/models/shared/connections.ts index 1278d54c3..1cee13298 100644 --- a/sync-for-expenses/src/sdk/models/shared/connections.ts +++ b/sync-for-expenses/src/sdk/models/shared/connections.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Connection, Connection$inboundSchema } from "./connection.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Connections = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Connections$inboundSchema: z.ZodType< - Connections, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Connection$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function connectionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Connections$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Connections' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Connection } from './connection'; +import { + ConnectionFromJSON, + ConnectionFromJSONTyped, + ConnectionToJSON, + ConnectionToJSONTyped, +} from './connection'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Connections + */ +export interface Connections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +/** + * Check if a given object implements the Connections interface. + */ +export function instanceOfConnections(value: object): value is Connections { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function ConnectionsFromJSON(json: any): Connections { + return ConnectionsFromJSONTyped(json, false); +} + +export function ConnectionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Connections { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(ConnectionFromJSON)), + }; +} + +export function ConnectionsToJSON(json: any): Connections { + return ConnectionsToJSONTyped(json, false); +} + +export function ConnectionsToJSONTyped(value?: Connections | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(ConnectionToJSON)), + }; +} + + +export interface ConnectionsListResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; +} + +export interface ListConnectionsResponseConnections { + /** + * Current page number. + * @type {number} + * @memberof Connections + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Connections + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Connections + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Connections + */ + links: Links; + /** + * + * @type {Array} + * @memberof Connections + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/contact.ts b/sync-for-expenses/src/sdk/models/shared/contact.ts index 8b386531d..ce26171e7 100644 --- a/sync-for-expenses/src/sdk/models/shared/contact.ts +++ b/sync-for-expenses/src/sdk/models/shared/contact.ts @@ -1,114 +1,364 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { CustomerStatus } from './customerstatus'; import { - CustomerStatus, - CustomerStatus$inboundSchema, - CustomerStatus$outboundSchema, -} from "./customerstatus.js"; + CustomerStatusFromJSON, + CustomerStatusFromJSONTyped, + CustomerStatusToJSON, + CustomerStatusToJSONTyped, +} from './customerstatus'; +import type { Items } from './items'; import { - Items, - Items$inboundSchema, - Items$Outbound, - Items$outboundSchema, -} from "./items.js"; + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './items'; +import type { PhoneNumberItems } from './phonenumberitems'; import { - PhoneNumberItems, - PhoneNumberItems$inboundSchema, - PhoneNumberItems$Outbound, - PhoneNumberItems$outboundSchema, -} from "./phonenumberitems.js"; - -export type Contact = { - /** - * Name of a contact for a customer. - */ - name?: string | null | undefined; - /** - * Email of a contact for a customer. - */ - email?: string | null | undefined; - /** - * An array of Phone numbers. - */ - phone?: Array | null | undefined; - address?: Items | undefined; - /** - * Status of customer. - */ - status: CustomerStatus; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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 | undefined; -}; - -/** @internal */ -export const Contact$inboundSchema: z.ZodType = - z.object({ - name: z.nullable(z.string()).optional(), - email: z.nullable(z.string()).optional(), - phone: z.nullable(z.array(PhoneNumberItems$inboundSchema)).optional(), - address: Items$inboundSchema.optional(), - status: CustomerStatus$inboundSchema, - modifiedDate: z.string().optional(), - }); -/** @internal */ -export type Contact$Outbound = { - name?: string | null | undefined; - email?: string | null | undefined; - phone?: Array | null | undefined; - address?: Items$Outbound | undefined; - status: string; - modifiedDate?: string | undefined; -}; - -/** @internal */ -export const Contact$outboundSchema: z.ZodType< - Contact$Outbound, - z.ZodTypeDef, - Contact -> = z.object({ - name: z.nullable(z.string()).optional(), - email: z.nullable(z.string()).optional(), - phone: z.nullable(z.array(PhoneNumberItems$outboundSchema)).optional(), - address: Items$outboundSchema.optional(), - status: CustomerStatus$outboundSchema, - modifiedDate: z.string().optional(), -}); - -export function contactToJSON(contact: Contact): string { - return JSON.stringify(Contact$outboundSchema.parse(contact)); + PhoneNumberItemsFromJSON, + PhoneNumberItemsFromJSONTyped, + PhoneNumberItemsToJSON, + PhoneNumberItemsToJSONTyped, +} from './phonenumberitems'; + +/** + * + * @export + * @interface Contact + */ +export interface Contact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; +} + + + +/** + * Check if a given object implements the Contact interface. + */ +export function instanceOfContact(value: object): value is Contact { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function ContactFromJSON(json: any): Contact { + return ContactFromJSONTyped(json, false); +} + +export function ContactFromJSONTyped(json: any, ignoreDiscriminator: boolean): Contact { + if (json == null) { + return json; + } + return { + + 'name': json['name'] == null ? undefined : json['name'], + 'email': json['email'] == null ? undefined : json['email'], + 'phone': json['phone'] == null ? undefined : ((json['phone'] as Array).map(PhoneNumberItemsFromJSON)), + 'address': json['address'] == null ? undefined : ItemsFromJSON(json['address']), + 'status': CustomerStatusFromJSON(json['status']), + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + }; +} + +export function ContactToJSON(json: any): Contact { + return ContactToJSONTyped(json, false); +} + +export function ContactToJSONTyped(value?: Contact | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'name': value['name'], + 'email': value['email'], + 'phone': value['phone'] == null ? undefined : ((value['phone'] as Array).map(PhoneNumberItemsToJSON)), + 'address': ItemsToJSON(value['address']), + 'status': CustomerStatusToJSON(value['status']), + 'modifiedDate': value['modifiedDate'], + }; +} + + +export interface AccountingCustomerContact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; +} + +export interface CreateCustomerResponseContact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; } -export function contactFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Contact$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Contact' from JSON`, - ); + +export interface CustomerContact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; +} + +export interface CustomerGetResponseContact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; +} + +export interface GetCustomerResponseContact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; +} + +export interface UpdateCustomerResponseContact { + /** + * Name of a contact for a customer. + * @type {string} + * @memberof Contact + */ + name?: string | null; + /** + * Email of a contact for a customer. + * @type {string} + * @memberof Contact + */ + email?: string | null; + /** + * An array of Phone numbers. + * @type {Array} + * @memberof Contact + */ + phone?: Array | null; + /** + * An object of Address information. + * @type {Items} + * @memberof Contact + */ + address?: Items; + /** + * + * @type {CustomerStatus} + * @memberof Contact + */ + status: CustomerStatus; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof Contact + */ + modifiedDate?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/createaccountresponse.ts b/sync-for-expenses/src/sdk/models/shared/createaccountresponse.ts index 139da5baa..7db32c6d6 100644 --- a/sync-for-expenses/src/sdk/models/shared/createaccountresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/createaccountresponse.ts @@ -1,413 +1,439 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { AccountStatus, AccountStatus$inboundSchema } from "./accountstatus.js"; -import { AccountType, AccountType$inboundSchema } from "./accounttype.js"; +import type { AccountingAccount } from '../Account'; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { CreateAccountResponseAllOfData } from '../CreateAccountResponseAllOfData'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; + CreateAccountResponseAllOfDataFromJSON, + CreateAccountResponseAllOfDataFromJSONTyped, + CreateAccountResponseAllOfDataToJSON, + CreateAccountResponseAllOfDataToJSONTyped, +} from '../CreateAccountResponseAllOfData'; +import type { PushOperationChange } from './pushoperationchange'; import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. - * - * @remarks - * - * For example, `validDatatypeLinks` might indicate the following references: - * - * - Which tax rates are valid to use on the line item of a bill. - * - Which items can be used when creating an invoice. - * - * You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. - * - * ## `validDatatypeLinks` example - * - * The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. - * - * ```json validDatatypeLinks for an account - * { - * "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", - * "nominalCode": "090", - * "name": "Business Bank Account", - * #... - * "validDatatypeLinks": [ - * { - * "property": "Id", - * "links": [ - * "Payment.AccountRef.Id", - * "BillPayment.AccountRef.Id", - * "DirectIncome.LineItems.AccountRef.Id", - * "DirectCost.LineItems.AccountRef.Id" - * ] - * } - * ] - * } - * ``` - * - * ## Support for `validDatatypeLinks` - * - * Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. - * - * If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + * + * @export + * @interface CreateAccountResponse */ -export type CreateAccountResponseValidDataTypeLinks = { - /** - * The property from the account that can be linked. - */ - property?: string | null | undefined; - /** - * Supported `dataTypes` that the record can be linked to. - */ - links?: Array | null | undefined; -}; +export interface CreateAccountResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateAccountResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateAccountResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateAccountResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateAccountResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateAccountResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateAccountResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateAccountResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateAccountResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateAccountResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateAccountResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateAccountResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateAccountResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateAccountResponse + */ + statusCode: number; + /** + * + * @type {CreateAccountResponseAllOfData} + * @memberof CreateAccountResponse + */ + data?: AccountingAccount | null; +} -export type CreateAccountResponseMetadata = { - /** - * Indicates whether the record has been deleted in the third-party system this record originated from. - */ - isDeleted?: boolean | null | undefined; -}; /** - * > **Language tip:** Accounts are also referred to as **chart of accounts**, **nominal accounts**, and **general ledger**. - * - * @remarks - * - * ## Overview - * - * Accounts are the categories a business uses to record accounting transactions. From the Accounts endpoints, you can retrieve a list of all accounts for a specified company. - * - * The categories for an account include: - * * Asset - * * Expense - * * Income - * * Liability - * * Equity. - * - * The same account may have a different category based on the integration it is used in. For example, a current account (known as checking in the US) should be categorized as `Asset.Current` for Xero, and `Asset.Bank.Checking` for QuickBooks Online. - * - * At the same time, each integration may have its own requirements to the categories. For example, a Paypal account in Xero is of the `Asset.Bank` category and therefore requires additional properties to be provided. - * - * To determine the list of allowed categories for a specific integration, you can: - * - Follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide and use the [Get create account model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-chartOfAccounts-model). - * - Refer to the integration's own documentation. - * - * > **Accounts with no category** - * > - * > If an account is pulled from the chart of accounts and its nominal code does not lie within the category layout for the company's accounts, then the **type** is `Unknown`. The **fullyQualifiedCategory** and **fullyQualifiedName** fields return `null`. - * > - * > This approach gives a true representation of the company's accounts whilst preventing distorting financials such as a company's profit and loss and balance sheet reports. - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * @export */ -export type AccountingAccount = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the account, unique for the company. - */ - id?: string | undefined; - /** - * 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. - */ - nominalCode?: string | null | undefined; - /** - * Name of the account. - */ - name?: string | null | undefined; - /** - * Description for the account. - */ - description?: string | null | undefined; - /** - * Full category of the account. - * - * @remarks - * - * For example, `Liability.Current` or `Income.Revenue`. To determine a list of possible categories for each integration, see our examples, follow our [Create, update, delete data](https://docs.codat.io/using-the-api/push) guide, or refer to the integration's own documentation. - */ - fullyQualifiedCategory?: string | null | undefined; - /** - * Full name of the account, for example: - * - * @remarks - * - `Cash On Hand` - * - `Rents Held In Trust` - * - `Fixed Asset` - */ - fullyQualifiedName?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Current balance in the account. - */ - currentBalance?: Decimal$ | number | null | undefined; - /** - * Type of account - */ - type?: AccountType | undefined; - /** - * Status of the account - */ - status?: AccountStatus | undefined; - /** - * Confirms whether the account is a bank account or not. - */ - isBankAccount?: boolean | undefined; - /** - * The validDatatypeLinks can be used to determine whether an account can be correctly mapped to another object; for example, accounts with a `type` of `income` might only support being used on an Invoice and Direct Income. For more information, see [Valid Data Type Links](/sync-for-expenses-api#/schemas/ValidDataTypeLinks). - */ - validDatatypeLinks?: - | Array - | null - | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; - metadata?: CreateAccountResponseMetadata | undefined; -}; +export const CreateAccountResponseDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type CreateAccountResponseDataTypeEnum = typeof CreateAccountResponseDataTypeEnum[keyof typeof CreateAccountResponseDataTypeEnum]; -export type CreateAccountResponse = { - data?: AccountingAccount | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; -/** @internal */ -export const CreateAccountResponseValidDataTypeLinks$inboundSchema: z.ZodType< - CreateAccountResponseValidDataTypeLinks, - z.ZodTypeDef, - unknown -> = z.object({ - property: z.nullable(z.string()).optional(), - links: z.nullable(z.array(z.string())).optional(), -}); +/** + * Check if a given object implements the CreateAccountResponse interface. + */ +export function instanceOfCreateAccountResponse(value: object): value is CreateAccountResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} -export function createAccountResponseValidDataTypeLinksFromJSON( - jsonString: string, -): SafeParseResult< - CreateAccountResponseValidDataTypeLinks, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - CreateAccountResponseValidDataTypeLinks$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'CreateAccountResponseValidDataTypeLinks' from JSON`, - ); +export function CreateAccountResponseFromJSON(json: any): CreateAccountResponse { + return CreateAccountResponseFromJSONTyped(json, false); } -/** @internal */ -export const CreateAccountResponseMetadata$inboundSchema: z.ZodType< - CreateAccountResponseMetadata, - z.ZodTypeDef, - unknown -> = z.object({ - isDeleted: z.nullable(z.boolean()).optional(), -}); +export function CreateAccountResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAccountResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : CreateAccountResponseAllOfDataFromJSON(json['data']), + }; +} -export function createAccountResponseMetadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateAccountResponseMetadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateAccountResponseMetadata' from JSON`, - ); +export function CreateAccountResponseToJSON(json: any): CreateAccountResponse { + return CreateAccountResponseToJSONTyped(json, false); } -/** @internal */ -export const AccountingAccount$inboundSchema: z.ZodType< - AccountingAccount, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - nominalCode: z.nullable(z.string()).optional(), - name: z.nullable(z.string()).optional(), - description: z.nullable(z.string()).optional(), - fullyQualifiedCategory: z.nullable(z.string()).optional(), - fullyQualifiedName: z.nullable(z.string()).optional(), - currency: z.string().optional(), - currentBalance: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - type: AccountType$inboundSchema.optional(), - status: AccountStatus$inboundSchema.optional(), - isBankAccount: z.boolean().optional(), - validDatatypeLinks: z.nullable( - z.array( - z.lazy(() => CreateAccountResponseValidDataTypeLinks$inboundSchema), - ), - ).optional(), - supplementalData: SupplementalData$inboundSchema.optional(), - metadata: z.lazy(() => CreateAccountResponseMetadata$inboundSchema) - .optional(), -}); +export function CreateAccountResponseToJSONTyped(value?: CreateAccountResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function accountingAccountFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountingAccount$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountingAccount' from JSON`, - ); + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': CreateAccountResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const CreateAccountResponse$inboundSchema: z.ZodType< - CreateAccountResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable(z.lazy(() => AccountingAccount$inboundSchema)).optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); -export function createAccountResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateAccountResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateAccountResponse' from JSON`, - ); +export interface AccountCreateResponseCreateAccountResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateAccountResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateAccountResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateAccountResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateAccountResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateAccountResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateAccountResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateAccountResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateAccountResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateAccountResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateAccountResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateAccountResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateAccountResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateAccountResponse + */ + statusCode: number; + /** + * + * @type {CreateAccountResponseAllOfData} + * @memberof CreateAccountResponse + */ + data?: CreateAccountResponseAllOfData | null; +} + +export interface CreateAccountResponseCreateAccountResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateAccountResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateAccountResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateAccountResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateAccountResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateAccountResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateAccountResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateAccountResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateAccountResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateAccountResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateAccountResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateAccountResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateAccountResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateAccountResponse + */ + statusCode: number; + /** + * + * @type {CreateAccountResponseAllOfData} + * @memberof CreateAccountResponse + */ + data?: CreateAccountResponseAllOfData | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/createbankaccountresponse.ts b/sync-for-expenses/src/sdk/models/shared/createbankaccountresponse.ts index a469b4f9a..05c945f48 100644 --- a/sync-for-expenses/src/sdk/models/shared/createbankaccountresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/createbankaccountresponse.ts @@ -1,340 +1,439 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { AccountingBankAccount } from './bankaccount'; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - BankAccountStatus, - BankAccountStatus$inboundSchema, -} from "./bankaccountstatus.js"; -import { Metadata, Metadata$inboundSchema } from "./metadata.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { CreateBankAccountResponseAllOfData } from '../CreateBankAccountResponseAllOfData'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + CreateBankAccountResponseAllOfDataFromJSON, + CreateBankAccountResponseAllOfDataFromJSONTyped, + CreateBankAccountResponseAllOfDataToJSON, + CreateBankAccountResponseAllOfDataToJSONTyped, +} from '../CreateBankAccountResponseAllOfData'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { PushOperationChange } from './pushoperationchange'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; -import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * + * @export + * @interface CreateBankAccountResponse */ -export const CreateBankAccountResponseBankAccountType = { - Unknown: "Unknown", - Credit: "Credit", - Debit: "Debit", -} as const; +export interface CreateBankAccountResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankAccountResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateBankAccountResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankAccountResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankAccountResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateBankAccountResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateBankAccountResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankAccountResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankAccountResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankAccountResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankAccountResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankAccountResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankAccountResponse + */ + statusCode: number; + /** + * + * @type {CreateBankAccountResponseAllOfData} + * @memberof CreateBankAccountResponse + */ + data?: AccountingBankAccount | null; +} + + /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. + * @export */ -export type CreateBankAccountResponseBankAccountType = ClosedEnum< - typeof CreateBankAccountResponseBankAccountType ->; +export const CreateBankAccountResponseDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type CreateBankAccountResponseDataTypeEnum = typeof CreateBankAccountResponseDataTypeEnum[keyof typeof CreateBankAccountResponseDataTypeEnum]; + /** - * > **Accessing Bank Accounts through Banking API** - * - * @remarks - * > - * > This datatype was originally used for accessing bank account data both in accounting integrations and open banking aggregators. - * > - * > To view bank account data through the Banking API, please refer to the new [Banking: Account](https://docs.codat.io/sync-for-expenses-api#/schemas/Account) data type. - * - * ## Overview - * - * A list of bank accounts associated with a company and a specific data connection. - * - * Bank accounts data includes: - * * The name and ID of the account in the accounting software. - * * The currency and balance of the account. - * * The sort code and account number. - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * Check if a given object implements the CreateBankAccountResponse interface. */ -export type AccountingBankAccount = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the account, unique for the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the bank account in the accounting software. - */ - accountName?: string | null | undefined; - /** - * The type of transactions and balances on the account. - * - * @remarks - * For Credit accounts, positive balances are liabilities, and positive transactions **reduce** liabilities. - * For Debit accounts, positive balances are assets, and positive transactions **increase** assets. - */ - accountType?: CreateBankAccountResponseBankAccountType | undefined; - /** - * Code used to identify each nominal account for a business. - */ - nominalCode?: string | null | undefined; - /** - * Sort code for the bank account. - * - * @remarks - * - * 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. - */ - sortCode?: string | null | undefined; - /** - * Account number for the bank account. - * - * @remarks - * - * 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. - */ - accountNumber?: string | null | undefined; - /** - * International bank account number of the account. Often used when making or receiving international payments. - */ - iBan?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## Unknown currencies - * - * In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. - * - * There are only a very small number of edge cases where this currency code is returned by the Codat system. - */ - currency?: string | undefined; - /** - * Balance of the bank account. - */ - balance?: Decimal$ | number | null | undefined; - /** - * The institution of the bank account. - */ - institution?: string | null | undefined; - /** - * 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. - */ - availableBalance?: Decimal$ | number | null | undefined; - /** - * Pre-arranged overdraft limit of the account. - * - * @remarks - * - * The value is always positive. For example, an overdraftLimit of `1000` means that the balance of the account can go down to `-1000`. - */ - overdraftLimit?: Decimal$ | number | null | undefined; - /** - * Status of the bank account. - */ - status?: BankAccountStatus | undefined; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; +export function instanceOfCreateBankAccountResponse(value: object): value is CreateBankAccountResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} -export type CreateBankAccountResponse = { - data?: AccountingBankAccount | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; +export function CreateBankAccountResponseFromJSON(json: any): CreateBankAccountResponse { + return CreateBankAccountResponseFromJSONTyped(json, false); +} + +export function CreateBankAccountResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateBankAccountResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : CreateBankAccountResponseAllOfDataFromJSON(json['data']), + }; +} -/** @internal */ -export const CreateBankAccountResponseBankAccountType$inboundSchema: - z.ZodNativeEnum = z - .nativeEnum(CreateBankAccountResponseBankAccountType); +export function CreateBankAccountResponseToJSON(json: any): CreateBankAccountResponse { + return CreateBankAccountResponseToJSONTyped(json, false); +} -/** @internal */ -export const AccountingBankAccount$inboundSchema: z.ZodType< - AccountingBankAccount, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - accountName: z.nullable(z.string()).optional(), - accountType: CreateBankAccountResponseBankAccountType$inboundSchema - .optional(), - nominalCode: z.nullable(z.string()).optional(), - sortCode: z.nullable(z.string()).optional(), - accountNumber: z.nullable(z.string()).optional(), - iBan: z.nullable(z.string()).optional(), - currency: z.string().optional(), - balance: z.nullable(z.number().transform(v => new Decimal$(v))).optional(), - institution: z.nullable(z.string()).optional(), - availableBalance: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - overdraftLimit: z.nullable(z.number().transform(v => new Decimal$(v))) - .optional(), - status: BankAccountStatus$inboundSchema.optional(), - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); +export function CreateBankAccountResponseToJSONTyped(value?: CreateBankAccountResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function accountingBankAccountFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountingBankAccount$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountingBankAccount' from JSON`, - ); + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': CreateBankAccountResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const CreateBankAccountResponse$inboundSchema: z.ZodType< - CreateBankAccountResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable(z.lazy(() => AccountingBankAccount$inboundSchema)) - .optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); -export function createBankAccountResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateBankAccountResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateBankAccountResponse' from JSON`, - ); +export interface BankAccountCreateResponseCreateBankAccountResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankAccountResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateBankAccountResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankAccountResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankAccountResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateBankAccountResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateBankAccountResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankAccountResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankAccountResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankAccountResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankAccountResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankAccountResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankAccountResponse + */ + statusCode: number; + /** + * + * @type {CreateBankAccountResponseAllOfData} + * @memberof CreateBankAccountResponse + */ + data?: CreateBankAccountResponseAllOfData | null; +} + +export interface CreateBankAccountResponseCreateBankAccountResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateBankAccountResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateBankAccountResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateBankAccountResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateBankAccountResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateBankAccountResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateBankAccountResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateBankAccountResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankAccountResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateBankAccountResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateBankAccountResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateBankAccountResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateBankAccountResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateBankAccountResponse + */ + statusCode: number; + /** + * + * @type {CreateBankAccountResponseAllOfData} + * @memberof CreateBankAccountResponse + */ + data?: CreateBankAccountResponseAllOfData | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/createcustomerresponse.ts b/sync-for-expenses/src/sdk/models/shared/createcustomerresponse.ts index 70a6883c3..e49b5f180 100644 --- a/sync-for-expenses/src/sdk/models/shared/createcustomerresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/createcustomerresponse.ts @@ -1,268 +1,439 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Contact, Contact$inboundSchema } from "./contact.js"; -import { - CustomerStatus, - CustomerStatus$inboundSchema, -} from "./customerstatus.js"; -import { Items, Items$inboundSchema } from "./items.js"; -import { Metadata, Metadata$inboundSchema } from "./metadata.js"; +import type { AccountingCustomer } from './customer'; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { CreateCustomerResponseAllOfData } from '../CreateCustomerResponseAllOfData'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; + CreateCustomerResponseAllOfDataFromJSON, + CreateCustomerResponseAllOfDataFromJSONTyped, + CreateCustomerResponseAllOfDataToJSON, + CreateCustomerResponseAllOfDataToJSONTyped, +} from '../CreateCustomerResponseAllOfData'; +import type { PushOperationChange } from './pushoperationchange'; import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * ## Overview - * - * @remarks - * - * A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - * - * Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * + * @export + * @interface CreateCustomerResponse */ -export type AccountingCustomer = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the customer, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the customer as recorded in the accounting system, typically the company name. - */ - customerName?: string | null | undefined; - /** - * Name of the main contact for the identified customer. - */ - contactName?: string | null | undefined; - /** - * Email address the customer can be contacted by. - */ - emailAddress?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - defaultCurrency?: string | undefined; - /** - * Phone number the customer can be contacted by. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * An array of Contacts. - */ - contacts?: Array | null | undefined; - /** - * Company number. In the UK, this is typically the Companies House company registration number. - */ - registrationNumber?: string | null | undefined; - /** - * Company tax number. - */ - taxNumber?: string | null | undefined; - /** - * Status of customer. - */ - status: CustomerStatus; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; +export interface CreateCustomerResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateCustomerResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateCustomerResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateCustomerResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateCustomerResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateCustomerResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateCustomerResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateCustomerResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateCustomerResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateCustomerResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateCustomerResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateCustomerResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateCustomerResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateCustomerResponse + */ + statusCode: number; + /** + * + * @type {CreateCustomerResponseAllOfData} + * @memberof CreateCustomerResponse + */ + data?: AccountingCustomer | null; +} + -export type CreateCustomerResponse = { - data?: AccountingCustomer | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; +/** + * @export + */ +export const CreateCustomerResponseDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type CreateCustomerResponseDataTypeEnum = typeof CreateCustomerResponseDataTypeEnum[keyof typeof CreateCustomerResponseDataTypeEnum]; -/** @internal */ -export const AccountingCustomer$inboundSchema: z.ZodType< - AccountingCustomer, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - customerName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - defaultCurrency: z.string().optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$inboundSchema)).optional(), - contacts: z.nullable(z.array(Contact$inboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: CustomerStatus$inboundSchema, - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); -export function accountingCustomerFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountingCustomer$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountingCustomer' from JSON`, - ); +/** + * Check if a given object implements the CreateCustomerResponse interface. + */ +export function instanceOfCreateCustomerResponse(value: object): value is CreateCustomerResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function CreateCustomerResponseFromJSON(json: any): CreateCustomerResponse { + return CreateCustomerResponseFromJSONTyped(json, false); +} + +export function CreateCustomerResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateCustomerResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : CreateCustomerResponseAllOfDataFromJSON(json['data']), + }; +} + +export function CreateCustomerResponseToJSON(json: any): CreateCustomerResponse { + return CreateCustomerResponseToJSONTyped(json, false); +} + +export function CreateCustomerResponseToJSONTyped(value?: CreateCustomerResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': CreateCustomerResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const CreateCustomerResponse$inboundSchema: z.ZodType< - CreateCustomerResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable(z.lazy(() => AccountingCustomer$inboundSchema)).optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); -export function createCustomerResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateCustomerResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateCustomerResponse' from JSON`, - ); +export interface CreateCustomerResponseCreateCustomerResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateCustomerResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateCustomerResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateCustomerResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateCustomerResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateCustomerResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateCustomerResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateCustomerResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateCustomerResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateCustomerResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateCustomerResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateCustomerResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateCustomerResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateCustomerResponse + */ + statusCode: number; + /** + * + * @type {CreateCustomerResponseAllOfData} + * @memberof CreateCustomerResponse + */ + data?: CreateCustomerResponseAllOfData | null; +} + +export interface CustomerCreateResponseCreateCustomerResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateCustomerResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateCustomerResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateCustomerResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateCustomerResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateCustomerResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateCustomerResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateCustomerResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateCustomerResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateCustomerResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateCustomerResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateCustomerResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateCustomerResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateCustomerResponse + */ + statusCode: number; + /** + * + * @type {CreateCustomerResponseAllOfData} + * @memberof CreateCustomerResponse + */ + data?: CreateCustomerResponseAllOfData | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/createexpenseresponse.ts b/sync-for-expenses/src/sdk/models/shared/createexpenseresponse.ts index 06b938906..8a1198e77 100644 --- a/sync-for-expenses/src/sdk/models/shared/createexpenseresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/createexpenseresponse.ts @@ -1,34 +1,83 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateExpenseResponse = { - /** - * Unique id of sync created - */ - syncId?: string | undefined; -}; - -/** @internal */ -export const CreateExpenseResponse$inboundSchema: z.ZodType< - CreateExpenseResponse, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string().optional(), -}); - -export function createExpenseResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateExpenseResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateExpenseResponse' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CreateExpenseResponse + */ +export interface CreateExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateExpenseResponse + */ + syncId?: string; +} + +/** + * Check if a given object implements the CreateExpenseResponse interface. + */ +export function instanceOfCreateExpenseResponse(value: object): value is CreateExpenseResponse { + return true; +} + +export function CreateExpenseResponseFromJSON(json: any): CreateExpenseResponse { + return CreateExpenseResponseFromJSONTyped(json, false); +} + +export function CreateExpenseResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateExpenseResponse { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + }; +} + +export function CreateExpenseResponseToJSON(json: any): CreateExpenseResponse { + return CreateExpenseResponseToJSONTyped(json, false); +} + +export function CreateExpenseResponseToJSONTyped(value?: CreateExpenseResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + }; +} + + +export interface CreateExpenseTransactionResponseCreateExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateExpenseResponse + */ + syncId?: string; +} + +export interface ExpenseTransactionCreateResponseCreateExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateExpenseResponse + */ + syncId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/createreimbursableexpenseresponse.ts b/sync-for-expenses/src/sdk/models/shared/createreimbursableexpenseresponse.ts index 4e9005bea..f32055106 100644 --- a/sync-for-expenses/src/sdk/models/shared/createreimbursableexpenseresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/createreimbursableexpenseresponse.ts @@ -1,34 +1,101 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CreateReimbursableExpenseResponse = { - /** - * Unique id of sync created - */ - syncId?: string | undefined; -}; - -/** @internal */ -export const CreateReimbursableExpenseResponse$inboundSchema: z.ZodType< - CreateReimbursableExpenseResponse, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string().optional(), -}); - -export function createReimbursableExpenseResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateReimbursableExpenseResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateReimbursableExpenseResponse' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CreateReimbursableExpenseResponse + */ +export interface CreateReimbursableExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateReimbursableExpenseResponse + */ + syncId?: string; +} + +/** + * Check if a given object implements the CreateReimbursableExpenseResponse interface. + */ +export function instanceOfCreateReimbursableExpenseResponse(value: object): value is CreateReimbursableExpenseResponse { + return true; +} + +export function CreateReimbursableExpenseResponseFromJSON(json: any): CreateReimbursableExpenseResponse { + return CreateReimbursableExpenseResponseFromJSONTyped(json, false); +} + +export function CreateReimbursableExpenseResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateReimbursableExpenseResponse { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + }; +} + +export function CreateReimbursableExpenseResponseToJSON(json: any): CreateReimbursableExpenseResponse { + return CreateReimbursableExpenseResponseToJSONTyped(json, false); +} + +export function CreateReimbursableExpenseResponseToJSONTyped(value?: CreateReimbursableExpenseResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + }; +} + + +export interface CreateReimbursableExpenseTransactionResponseCreateReimbursableExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateReimbursableExpenseResponse + */ + syncId?: string; +} + +export interface ReimbursableExpenseTransactionCreateResponseCreateReimbursableExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateReimbursableExpenseResponse + */ + syncId?: string; +} + +export interface ReimbursableExpenseTransactionUpdateResponseCreateReimbursableExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateReimbursableExpenseResponse + */ + syncId?: string; +} + +export interface UpdateReimbursableExpenseTransactionResponseCreateReimbursableExpenseResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof CreateReimbursableExpenseResponse + */ + syncId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/createsupplierresponse.ts b/sync-for-expenses/src/sdk/models/shared/createsupplierresponse.ts index 1f0ed5664..24d262259 100644 --- a/sync-for-expenses/src/sdk/models/shared/createsupplierresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/createsupplierresponse.ts @@ -1,252 +1,439 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Items, Items$inboundSchema } from "./items.js"; -import { Metadata, Metadata$inboundSchema } from "./metadata.js"; +import type { AccountingSupplier } from './supplier'; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { CreateSupplierResponseAllOfData } from '../CreateSupplierResponseAllOfData'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; + CreateSupplierResponseAllOfDataFromJSON, + CreateSupplierResponseAllOfDataFromJSONTyped, + CreateSupplierResponseAllOfDataToJSON, + CreateSupplierResponseAllOfDataToJSONTyped, +} from '../CreateSupplierResponseAllOfData'; +import type { PushOperationChange } from './pushoperationchange'; import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; -import { - SupplierStatus, - SupplierStatus$inboundSchema, -} from "./supplierstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * ## Overview - * - * @remarks - * - * From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * + * @export + * @interface CreateSupplierResponse + */ +export interface CreateSupplierResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateSupplierResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateSupplierResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateSupplierResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateSupplierResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateSupplierResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateSupplierResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateSupplierResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateSupplierResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateSupplierResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateSupplierResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateSupplierResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateSupplierResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateSupplierResponse + */ + statusCode: number; + /** + * + * @type {CreateSupplierResponseAllOfData} + * @memberof CreateSupplierResponse + */ + data?: AccountingSupplier | null; +} + + +/** + * @export */ -export type AccountingSupplier = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the supplier, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the supplier as recorded in the accounting system, typically the company name. - */ - supplierName?: string | null | undefined; - /** - * Name of the main contact for the supplier. - */ - contactName?: string | null | undefined; - /** - * Email address that the supplier may be contacted on. - */ - emailAddress?: string | null | undefined; - /** - * Phone number that the supplier may be contacted on. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. - */ - registrationNumber?: string | null | undefined; - /** - * Supplier's company tax number. - */ - taxNumber?: string | null | undefined; - /** - * Status of the supplier. - */ - status: SupplierStatus; - /** - * Default currency the supplier's transactional data is recorded in. - */ - defaultCurrency?: string | null | undefined; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; +export const CreateSupplierResponseDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type CreateSupplierResponseDataTypeEnum = typeof CreateSupplierResponseDataTypeEnum[keyof typeof CreateSupplierResponseDataTypeEnum]; -export type CreateSupplierResponse = { - data?: AccountingSupplier | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; -/** @internal */ -export const AccountingSupplier$inboundSchema: z.ZodType< - AccountingSupplier, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - supplierName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$inboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: SupplierStatus$inboundSchema, - defaultCurrency: z.nullable(z.string()).optional(), - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); +/** + * Check if a given object implements the CreateSupplierResponse interface. + */ +export function instanceOfCreateSupplierResponse(value: object): value is CreateSupplierResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function CreateSupplierResponseFromJSON(json: any): CreateSupplierResponse { + return CreateSupplierResponseFromJSONTyped(json, false); +} + +export function CreateSupplierResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateSupplierResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : CreateSupplierResponseAllOfDataFromJSON(json['data']), + }; +} + +export function CreateSupplierResponseToJSON(json: any): CreateSupplierResponse { + return CreateSupplierResponseToJSONTyped(json, false); +} -export function accountingSupplierFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => AccountingSupplier$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'AccountingSupplier' from JSON`, - ); +export function CreateSupplierResponseToJSONTyped(value?: CreateSupplierResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': CreateSupplierResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const CreateSupplierResponse$inboundSchema: z.ZodType< - CreateSupplierResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable(z.lazy(() => AccountingSupplier$inboundSchema)).optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); -export function createSupplierResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CreateSupplierResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CreateSupplierResponse' from JSON`, - ); +export interface CreateSupplierResponseCreateSupplierResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateSupplierResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateSupplierResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateSupplierResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateSupplierResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateSupplierResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateSupplierResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateSupplierResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateSupplierResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateSupplierResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateSupplierResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateSupplierResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateSupplierResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateSupplierResponse + */ + statusCode: number; + /** + * + * @type {CreateSupplierResponseAllOfData} + * @memberof CreateSupplierResponse + */ + data?: CreateSupplierResponseAllOfData | null; +} + +export interface SupplierCreateResponseCreateSupplierResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof CreateSupplierResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof CreateSupplierResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof CreateSupplierResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof CreateSupplierResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof CreateSupplierResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof CreateSupplierResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof CreateSupplierResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof CreateSupplierResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof CreateSupplierResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof CreateSupplierResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof CreateSupplierResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof CreateSupplierResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof CreateSupplierResponse + */ + statusCode: number; + /** + * + * @type {CreateSupplierResponseAllOfData} + * @memberof CreateSupplierResponse + */ + data?: CreateSupplierResponseAllOfData | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/customer.ts b/sync-for-expenses/src/sdk/models/shared/customer.ts index 27486842b..c224190a4 100644 --- a/sync-for-expenses/src/sdk/models/shared/customer.ts +++ b/sync-for-expenses/src/sdk/models/shared/customer.ts @@ -1,189 +1,3179 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { SupplementalData } from './supplementaldata'; import { - Contact, - Contact$inboundSchema, - Contact$Outbound, - Contact$outboundSchema, -} from "./contact.js"; + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './supplementaldata'; +import type { CustomerStatus } from './customerstatus'; import { - CustomerStatus, - CustomerStatus$inboundSchema, - CustomerStatus$outboundSchema, -} from "./customerstatus.js"; + CustomerStatusFromJSON, + CustomerStatusFromJSONTyped, + CustomerStatusToJSON, + CustomerStatusToJSONTyped, +} from './customerstatus'; +import type { Metadata } from './metadata'; import { - Items, - Items$inboundSchema, - Items$Outbound, - Items$outboundSchema, -} from "./items.js"; + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './metadata'; +import type { Items } from './items'; import { - Metadata, - Metadata$inboundSchema, - Metadata$Outbound, - Metadata$outboundSchema, -} from "./metadata.js"; + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './items'; +import type { Contact } from './contact'; import { - SupplementalData, - SupplementalData$inboundSchema, - SupplementalData$Outbound, - SupplementalData$outboundSchema, -} from "./supplementaldata.js"; + ContactFromJSON, + ContactFromJSONTyped, + ContactToJSON, + ContactToJSONTyped, +} from './contact'; /** * ## Overview - * - * @remarks - * + * * A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - * + * * Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). + * + * @export + * @interface Customer */ -export type Customer = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the customer, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the customer as recorded in the accounting system, typically the company name. - */ - customerName?: string | null | undefined; - /** - * Name of the main contact for the identified customer. - */ - contactName?: string | null | undefined; - /** - * Email address the customer can be contacted by. - */ - emailAddress?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - defaultCurrency?: string | undefined; - /** - * Phone number the customer can be contacted by. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * An array of Contacts. - */ - contacts?: Array | null | undefined; - /** - * Company number. In the UK, this is typically the Companies House company registration number. - */ - registrationNumber?: string | null | undefined; - /** - * Company tax number. - */ - taxNumber?: string | null | undefined; - /** - * Status of customer. - */ - status: CustomerStatus; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; - -/** @internal */ -export const Customer$inboundSchema: z.ZodType< - Customer, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - customerName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - defaultCurrency: z.string().optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$inboundSchema)).optional(), - contacts: z.nullable(z.array(Contact$inboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: CustomerStatus$inboundSchema, - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); -/** @internal */ -export type Customer$Outbound = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - id?: string | undefined; - customerName?: string | null | undefined; - contactName?: string | null | undefined; - emailAddress?: string | null | undefined; - defaultCurrency?: string | undefined; - phone?: string | null | undefined; - addresses?: Array | null | undefined; - contacts?: Array | null | undefined; - registrationNumber?: string | null | undefined; - taxNumber?: string | null | undefined; - status: string; - metadata?: Metadata$Outbound | undefined; - supplementalData?: SupplementalData$Outbound | undefined; -}; - -/** @internal */ -export const Customer$outboundSchema: z.ZodType< - Customer$Outbound, - z.ZodTypeDef, - Customer -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - customerName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - defaultCurrency: z.string().optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$outboundSchema)).optional(), - contacts: z.nullable(z.array(Contact$outboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: CustomerStatus$outboundSchema, - metadata: Metadata$outboundSchema.optional(), - supplementalData: SupplementalData$outboundSchema.optional(), -}); - -export function customerToJSON(customer: Customer): string { - return JSON.stringify(Customer$outboundSchema.parse(customer)); -} -export function customerFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Customer$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Customer' from JSON`, - ); +export interface Customer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + + + +/** + * Check if a given object implements the Customer interface. + */ +export function instanceOfCustomer(value: object): value is Customer { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function CustomerFromJSON(json: any): Customer { + return CustomerFromJSONTyped(json, false); +} + +export function CustomerFromJSONTyped(json: any, ignoreDiscriminator: boolean): Customer { + if (json == null) { + return json; + } + return { + + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + 'id': json['id'] == null ? undefined : json['id'], + 'customerName': json['customerName'] == null ? undefined : json['customerName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(ItemsFromJSON)), + 'contacts': json['contacts'] == null ? undefined : ((json['contacts'] as Array).map(ContactFromJSON)), + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'status': CustomerStatusFromJSON(json['status']), + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + }; +} + +export function CustomerToJSON(json: any): Customer { + return CustomerToJSONTyped(json, false); +} + +export function CustomerToJSONTyped(value?: Customer | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + 'id': value['id'], + 'customerName': value['customerName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'defaultCurrency': value['defaultCurrency'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(ItemsToJSON)), + 'contacts': value['contacts'] == null ? undefined : ((value['contacts'] as Array).map(ContactToJSON)), + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'status': CustomerStatusToJSON(value['status']), + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + }; +} + + +export interface AccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CreateCustomerCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CreateCustomerRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CreateCustomerResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CreateCustomerResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerCreateRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerCreateResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerCreateResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerGetResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerGetResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerUpdateRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerUpdateResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomerUpdateResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomersAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomersCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomersListResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface CustomersListResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface GetCustomerResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface GetCustomerResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface ListCustomersResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface ListCustomersResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface UpdateCustomerCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface UpdateCustomerRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface UpdateCustomerResponseAccountingCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; +} + +export interface UpdateCustomerResponseCustomer { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Customer + */ + sourceModifiedDate?: string; + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof Customer + */ + id?: string; + /** + * Name of the customer as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Customer + */ + customerName?: string | null; + /** + * Name of the main contact for the identified customer. + * @type {string} + * @memberof Customer + */ + contactName?: string | null; + /** + * Email address the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + emailAddress?: string | null; + /** + * 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. + * @type {string} + * @memberof Customer + */ + defaultCurrency?: string; + /** + * Phone number the customer can be contacted by. + * @type {string} + * @memberof Customer + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Customer + */ + addresses?: Array | null; + /** + * An array of Contacts. + * @type {Array} + * @memberof Customer + */ + contacts?: Array | null; + /** + * Company number. In the UK, this is typically the Companies House company registration number. + * @type {string} + * @memberof Customer + */ + registrationNumber?: string | null; + /** + * Company tax number. + * @type {string} + * @memberof Customer + */ + taxNumber?: string | null; + /** + * Current state of the customer. + * @type {CustomerStatus} + * @memberof Customer + */ + status: CustomerStatus; + /** + * + * @type {Metadata} + * @memberof Customer + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Customer + */ + supplementalData?: SupplementalData; } diff --git a/sync-for-expenses/src/sdk/models/shared/customerdetails.ts b/sync-for-expenses/src/sdk/models/shared/customerdetails.ts index 63b35720d..6f40d1dfd 100644 --- a/sync-for-expenses/src/sdk/models/shared/customerdetails.ts +++ b/sync-for-expenses/src/sdk/models/shared/customerdetails.ts @@ -1,52 +1,110 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type CustomerDetails = { - /** - * Identifier for the customer, unique to the company in the accounting software. - */ - id?: string | undefined; -}; - -/** @internal */ -export const CustomerDetails$inboundSchema: z.ZodType< - CustomerDetails, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), -}); -/** @internal */ -export type CustomerDetails$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const CustomerDetails$outboundSchema: z.ZodType< - CustomerDetails$Outbound, - z.ZodTypeDef, - CustomerDetails -> = z.object({ - id: z.string().optional(), -}); - -export function customerDetailsToJSON( - customerDetails: CustomerDetails, -): string { - return JSON.stringify(CustomerDetails$outboundSchema.parse(customerDetails)); -} -export function customerDetailsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => CustomerDetails$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'CustomerDetails' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface CustomerDetails + */ +export interface CustomerDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CustomerDetails + */ + id?: string; +} + +/** + * Check if a given object implements the CustomerDetails interface. + */ +export function instanceOfCustomerDetails(value: object): value is CustomerDetails { + return true; +} + +export function CustomerDetailsFromJSON(json: any): CustomerDetails { + return CustomerDetailsFromJSONTyped(json, false); +} + +export function CustomerDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function CustomerDetailsToJSON(json: any): CustomerDetails { + return CustomerDetailsToJSONTyped(json, false); +} + +export function CustomerDetailsToJSONTyped(value?: CustomerDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface CompanyConfigurationCustomerDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CustomerDetails + */ + id?: string; +} + +export interface CompanyConfigurationGetResponseCustomerDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CustomerDetails + */ + id?: string; +} + +export interface CompanyConfigurationSetResponseCustomerDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CustomerDetails + */ + id?: string; +} + +export interface GetCompanyConfigurationResponseCustomerDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CustomerDetails + */ + id?: string; +} + +export interface SetCompanyConfigurationResponseCustomerDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof CustomerDetails + */ + id?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/customers.ts b/sync-for-expenses/src/sdk/models/shared/customers.ts index 1ab044756..03101a546 100644 --- a/sync-for-expenses/src/sdk/models/shared/customers.ts +++ b/sync-for-expenses/src/sdk/models/shared/customers.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Customer, Customer$inboundSchema } from "./customer.js"; -import { Links, Links$inboundSchema } from "./links.js"; - -export type Customers = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Customers$inboundSchema: z.ZodType< - Customers, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(z.nullable(Customer$inboundSchema)).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function customersFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Customers$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Customers' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Customer } from './customer'; +import { + CustomerFromJSON, + CustomerFromJSONTyped, + CustomerToJSON, + CustomerToJSONTyped, +} from './customer'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Customers + */ +export interface Customers { + /** + * Current page number. + * @type {number} + * @memberof Customers + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Customers + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Customers + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Customers + */ + links: Links; + /** + * + * @type {Array} + * @memberof Customers + */ + results?: Array; +} + +/** + * Check if a given object implements the Customers interface. + */ +export function instanceOfCustomers(value: object): value is Customers { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function CustomersFromJSON(json: any): Customers { + return CustomersFromJSONTyped(json, false); +} + +export function CustomersFromJSONTyped(json: any, ignoreDiscriminator: boolean): Customers { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(CustomerFromJSON)), + }; +} + +export function CustomersToJSON(json: any): Customers { + return CustomersToJSONTyped(json, false); +} + +export function CustomersToJSONTyped(value?: Customers | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(CustomerToJSON)), + }; +} + + +export interface CustomersListResponseCustomers { + /** + * Current page number. + * @type {number} + * @memberof Customers + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Customers + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Customers + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Customers + */ + links: Links; + /** + * + * @type {Array} + * @memberof Customers + */ + results?: Array; +} + +export interface ListCustomersResponseCustomers { + /** + * Current page number. + * @type {number} + * @memberof Customers + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Customers + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Customers + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Customers + */ + links: Links; + /** + * + * @type {Array} + * @memberof Customers + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/customerstatus.ts b/sync-for-expenses/src/sdk/models/shared/customerstatus.ts index 8529e7f29..ad2c29c1e 100644 --- a/sync-for-expenses/src/sdk/models/shared/customerstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/customerstatus.ts @@ -1,28 +1,54 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of customer. + * @export */ export const CustomerStatus = { - Unknown: "Unknown", - Active: "Active", - Archived: "Archived", + Unknown: 'Unknown', + Active: 'Active', + Archived: 'Archived' } as const; -/** - * Status of customer. - */ -export type CustomerStatus = ClosedEnum; - -/** @internal */ -export const CustomerStatus$inboundSchema: z.ZodNativeEnum< - typeof CustomerStatus -> = z.nativeEnum(CustomerStatus); -/** @internal */ -export const CustomerStatus$outboundSchema: z.ZodNativeEnum< - typeof CustomerStatus -> = CustomerStatus$inboundSchema; +export type CustomerStatus = typeof CustomerStatus[keyof typeof CustomerStatus]; + + +export function instanceOfCustomerStatus(value: any): boolean { + for (const key in CustomerStatus) { + if (Object.prototype.hasOwnProperty.call(CustomerStatus, key)) { + if (CustomerStatus[key as keyof typeof CustomerStatus] === value) { + return true; + } + } + } + return false; +} + +export function CustomerStatusFromJSON(json: any): CustomerStatus { + return CustomerStatusFromJSONTyped(json, false); +} + +export function CustomerStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): CustomerStatus { + return json as CustomerStatus; +} + +export function CustomerStatusToJSON(value?: CustomerStatus | null): any { + return value as any; +} + +export function CustomerStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): CustomerStatus { + return value as CustomerStatus; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/dataconnectionerror.ts b/sync-for-expenses/src/sdk/models/shared/dataconnectionerror.ts index 1cb816d0f..f6c614bf2 100644 --- a/sync-for-expenses/src/sdk/models/shared/dataconnectionerror.ts +++ b/sync-for-expenses/src/sdk/models/shared/dataconnectionerror.ts @@ -1,112 +1,468 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { ErrorStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface DataConnectionError + */ +export interface DataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * @export */ -export const ErrorStatus = { - Active: "Active", - Resolved: "Resolved", +export const DataConnectionErrorStatusEnum = { + Active: 'Active', + Resolved: 'Resolved' } as const; +export type DataConnectionErrorStatusEnum = typeof DataConnectionErrorStatusEnum[keyof typeof DataConnectionErrorStatusEnum]; + + /** - * The current status of a transient error. Null statuses indicate that the error is not transient. + * Check if a given object implements the DataConnectionError interface. */ -export type ErrorStatus = ClosedEnum; - -export type DataConnectionError = { - /** - * The HTTP status code returned by the source platform when the error occurred. - */ - statusCode?: string | undefined; - /** - * A non-numeric status code/text returned by the source platform when the error occurred. - */ - statusText?: string | undefined; - /** - * A message about a error returned by Codat. - */ - errorMessage?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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 | undefined; - /** - * The current status of a transient error. Null statuses indicate that the error is not transient. - */ - status?: ErrorStatus | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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 | undefined; -}; - -/** @internal */ -export const ErrorStatus$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(ErrorStatus); - -/** @internal */ -export const DataConnectionError$inboundSchema: z.ZodType< - DataConnectionError, - z.ZodTypeDef, - unknown -> = z.object({ - statusCode: z.string().optional(), - statusText: z.string().optional(), - errorMessage: z.string().optional(), - erroredOnUtc: z.string().optional(), - status: z.nullable(ErrorStatus$inboundSchema).optional(), - resolvedOnUtc: z.string().optional(), -}); - -export function dataConnectionErrorFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataConnectionError$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataConnectionError' from JSON`, - ); +export function instanceOfDataConnectionError(value: object): value is DataConnectionError { + return true; +} + +export function DataConnectionErrorFromJSON(json: any): DataConnectionError { + return DataConnectionErrorFromJSONTyped(json, false); +} + +export function DataConnectionErrorFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionError { + if (json == null) { + return json; + } + return { + + 'statusCode': json['statusCode'] == null ? undefined : json['statusCode'], + 'statusText': json['statusText'] == null ? undefined : json['statusText'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'erroredOnUtc': json['erroredOnUtc'] == null ? undefined : json['erroredOnUtc'], + 'status': json['status'] == null ? undefined : json['status'], + 'resolvedOnUtc': json['resolvedOnUtc'] == null ? undefined : json['resolvedOnUtc'], + }; +} + +export function DataConnectionErrorToJSON(json: any): DataConnectionError { + return DataConnectionErrorToJSONTyped(json, false); +} + +export function DataConnectionErrorToJSONTyped(value?: DataConnectionError | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'statusCode': value['statusCode'], + 'statusText': value['statusText'], + 'errorMessage': value['errorMessage'], + 'erroredOnUtc': value['erroredOnUtc'], + 'status': value['status'], + 'resolvedOnUtc': value['resolvedOnUtc'], + }; +} + + +export interface ConnectionCreateResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface ConnectionDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface ConnectionGetResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface ConnectionUnlinkResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface CreateConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface CreatePartnerExpenseConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface GetConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface PartnerExpenseConnectionCreateResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; +} + +export interface UnlinkConnectionResponseDataConnectionError { + /** + * The HTTP status code returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusCode?: string; + /** + * A non-numeric status code/text returned by the source platform when the error occurred. + * @type {string} + * @memberof DataConnectionError + */ + statusText?: string; + /** + * A message about a error returned by Codat. + * @type {string} + * @memberof DataConnectionError + */ + errorMessage?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataConnectionError + */ + erroredOnUtc?: string; + /** + * The current status of a transient error. Null statuses indicate that the error is not transient. + * @type {string} + * @memberof DataConnectionError + */ + status?: ErrorStatus | null; + /** + * The datetime in Utc that the error was resolved. + * @type {string} + * @memberof DataConnectionError + */ + resolvedOnUtc?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/dataconnectionstatus.ts b/sync-for-expenses/src/sdk/models/shared/dataconnectionstatus.ts index 88889c800..8fc782ac6 100644 --- a/sync-for-expenses/src/sdk/models/shared/dataconnectionstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/dataconnectionstatus.ts @@ -1,29 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current authorization status of the data connection. + * @export */ export const DataConnectionStatus = { - PendingAuth: "PendingAuth", - Linked: "Linked", - Unlinked: "Unlinked", - Deauthorized: "Deauthorized", + PendingAuth: 'PendingAuth', + Linked: 'Linked', + Unlinked: 'Unlinked', + Deauthorized: 'Deauthorized' } as const; -/** - * The current authorization status of the data connection. - */ -export type DataConnectionStatus = ClosedEnum; - -/** @internal */ -export const DataConnectionStatus$inboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = z.nativeEnum(DataConnectionStatus); -/** @internal */ -export const DataConnectionStatus$outboundSchema: z.ZodNativeEnum< - typeof DataConnectionStatus -> = DataConnectionStatus$inboundSchema; +export type DataConnectionStatus = typeof DataConnectionStatus[keyof typeof DataConnectionStatus]; + + +export function instanceOfDataConnectionStatus(value: any): boolean { + for (const key in DataConnectionStatus) { + if (Object.prototype.hasOwnProperty.call(DataConnectionStatus, key)) { + if (DataConnectionStatus[key as keyof typeof DataConnectionStatus] === value) { + return true; + } + } + } + return false; +} + +export function DataConnectionStatusFromJSON(json: any): DataConnectionStatus { + return DataConnectionStatusFromJSONTyped(json, false); +} + +export function DataConnectionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return json as DataConnectionStatus; +} + +export function DataConnectionStatusToJSON(value?: DataConnectionStatus | null): any { + return value as any; +} + +export function DataConnectionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): DataConnectionStatus { + return value as DataConnectionStatus; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/datastatus.ts b/sync-for-expenses/src/sdk/models/shared/datastatus.ts index 431478c2d..4153a6c7f 100644 --- a/sync-for-expenses/src/sdk/models/shared/datastatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/datastatus.ts @@ -1,134 +1,251 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { Status } from './status'; +import type { DataTypes } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +/** + * Describes the state of data in the Codat cache for a company and data type + * @export + * @interface DataStatus */ +export interface DataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: Status; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; +} -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Status, Status$inboundSchema } from "./status.js"; /** - * Available data types + * @export */ -export const DataTypes = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", +export const DataStatusDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' } as const; +export type DataStatusDataTypeEnum = typeof DataStatusDataTypeEnum[keyof typeof DataStatusDataTypeEnum]; + /** - * Available data types + * @export */ -export type DataTypes = ClosedEnum; +export const DataStatusCurrentStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type DataStatusCurrentStatusEnum = typeof DataStatusCurrentStatusEnum[keyof typeof DataStatusCurrentStatusEnum]; + /** - * Describes the state of data in the Codat cache for a company and data type + * Check if a given object implements the DataStatus interface. */ -export type DataStatus = { - /** - * Available data types - */ - dataType: DataTypes; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - lastSuccessfulSync?: string | undefined; - /** - * The current status of the dataset. - */ - currentStatus: Status; - /** - * Unique identifier for most recent sync of data type. - */ - latestSyncId?: string | undefined; - /** - * Unique identifier for the most recent successful sync of data type. - */ - latestSuccessfulSyncId?: string | undefined; -}; +export function instanceOfDataStatus(value: object): value is DataStatus { + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('currentStatus' in value) || value['currentStatus'] === undefined) return false; + return true; +} -/** @internal */ -export const DataTypes$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataTypes); +export function DataStatusFromJSON(json: any): DataStatus { + return DataStatusFromJSONTyped(json, false); +} + +export function DataStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataStatus { + if (json == null) { + return json; + } + return { + + 'dataType': json['dataType'], + 'lastSuccessfulSync': json['lastSuccessfulSync'] == null ? undefined : json['lastSuccessfulSync'], + 'currentStatus': json['currentStatus'], + 'latestSyncId': json['latestSyncId'] == null ? undefined : json['latestSyncId'], + 'latestSuccessfulSyncId': json['latestSuccessfulSyncId'] == null ? undefined : json['latestSuccessfulSyncId'], + }; +} + +export function DataStatusToJSON(json: any): DataStatus { + return DataStatusToJSONTyped(json, false); +} -/** @internal */ -export const DataStatus$inboundSchema: z.ZodType< - DataStatus, - z.ZodTypeDef, - unknown -> = z.object({ - dataType: DataTypes$inboundSchema, - lastSuccessfulSync: z.string().optional(), - currentStatus: Status$inboundSchema, - latestSyncId: z.string().optional(), - latestSuccessfulSyncId: z.string().optional(), -}); +export function DataStatusToJSONTyped(value?: DataStatus | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'dataType': value['dataType'], + 'lastSuccessfulSync': value['lastSuccessfulSync'], + 'currentStatus': value['currentStatus'], + 'latestSyncId': value['latestSyncId'], + 'latestSuccessfulSyncId': value['latestSuccessfulSyncId'], + }; +} + + +export interface DataStatusGetResponseDataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: DataStatusCurrentStatusEnum; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; +} -export function dataStatusFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DataStatus$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DataStatus' from JSON`, - ); +export interface GetDataStatusResponseDataStatus { + /** + * Available data types + * @type {string} + * @memberof DataStatus + */ + dataType: DataTypes; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof DataStatus + */ + lastSuccessfulSync?: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof DataStatus + */ + currentStatus: DataStatusCurrentStatusEnum; + /** + * Unique identifier for most recent sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSyncId?: string; + /** + * Unique identifier for the most recent successful sync of data type. + * @type {string} + * @memberof DataStatus + */ + latestSuccessfulSyncId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/datatype.ts b/sync-for-expenses/src/sdk/models/shared/datatype.ts index e1060cb84..bd4ac0914 100644 --- a/sync-for-expenses/src/sdk/models/shared/datatype.ts +++ b/sync-for-expenses/src/sdk/models/shared/datatype.ts @@ -1,63 +1,99 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ + +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Available data types + * @export */ export const DataType = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' } as const; -/** - * Available data types - */ -export type DataType = ClosedEnum; +export type DataType = typeof DataType[keyof typeof DataType]; + + +export function instanceOfDataType(value: any): boolean { + for (const key in DataType) { + if (Object.prototype.hasOwnProperty.call(DataType, key)) { + if (DataType[key as keyof typeof DataType] === value) { + return true; + } + } + } + return false; +} + +export function DataTypeFromJSON(json: any): DataType { + return DataTypeFromJSONTyped(json, false); +} + +export function DataTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): DataType { + return json as DataType; +} + +export function DataTypeToJSON(value?: DataType | null): any { + return value as any; +} + +export function DataTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): DataType { + return value as DataType; +} -/** @internal */ -export const DataType$outboundSchema: z.ZodNativeEnum = z - .nativeEnum(DataType); diff --git a/sync-for-expenses/src/sdk/models/shared/definitiontransaction.ts b/sync-for-expenses/src/sdk/models/shared/definitiontransaction.ts index 9fe243202..c5ca1899d 100644 --- a/sync-for-expenses/src/sdk/models/shared/definitiontransaction.ts +++ b/sync-for-expenses/src/sdk/models/shared/definitiontransaction.ts @@ -1,93 +1,117 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { TransactionStatus1 } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface DefinitionTransaction + */ +export interface DefinitionTransaction { + /** + * Unique identifier of the transaction. + * @type {string} + * @memberof DefinitionTransaction + */ + id?: string; + /** + * Status of transaction. + * @type {string} + * @memberof DefinitionTransaction + */ + status?: TransactionStatus1; + /** + * Error message for failed transaction. + * @type {string} + * @memberof DefinitionTransaction + */ + errorMessage?: string | null; +} + /** - * Status of transaction. + * @export */ -export const TransactionStatus1 = { - Unknown: "Unknown", - PushError: "PushError", - Completed: "Completed", - Failed: "Failed", - Pending: "Pending", +export const DefinitionTransactionStatusEnum = { + Unknown: 'Unknown', + PushError: 'PushError', + Completed: 'Completed', + Failed: 'Failed', + Pending: 'Pending' } as const; +export type DefinitionTransactionStatusEnum = typeof DefinitionTransactionStatusEnum[keyof typeof DefinitionTransactionStatusEnum]; + + /** - * Status of transaction. + * Check if a given object implements the DefinitionTransaction interface. */ -export type TransactionStatus1 = ClosedEnum; +export function instanceOfDefinitionTransaction(value: object): value is DefinitionTransaction { + return true; +} -export type DefinitionTransaction = { - /** - * Unique identifier of the transaction. - */ - id?: string | undefined; - /** - * Status of transaction. - */ - status?: TransactionStatus1 | undefined; - /** - * Error message for failed transaction. - */ - errorMessage?: string | null | undefined; -}; +export function DefinitionTransactionFromJSON(json: any): DefinitionTransaction { + return DefinitionTransactionFromJSONTyped(json, false); +} -/** @internal */ -export const TransactionStatus1$inboundSchema: z.ZodNativeEnum< - typeof TransactionStatus1 -> = z.nativeEnum(TransactionStatus1); -/** @internal */ -export const TransactionStatus1$outboundSchema: z.ZodNativeEnum< - typeof TransactionStatus1 -> = TransactionStatus1$inboundSchema; +export function DefinitionTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): DefinitionTransaction { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'status': json['status'] == null ? undefined : json['status'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + }; +} -/** @internal */ -export const DefinitionTransaction$inboundSchema: z.ZodType< - DefinitionTransaction, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - status: TransactionStatus1$inboundSchema.optional(), - errorMessage: z.nullable(z.string()).optional(), -}); -/** @internal */ -export type DefinitionTransaction$Outbound = { - id?: string | undefined; - status?: string | undefined; - errorMessage?: string | null | undefined; -}; +export function DefinitionTransactionToJSON(json: any): DefinitionTransaction { + return DefinitionTransactionToJSONTyped(json, false); +} -/** @internal */ -export const DefinitionTransaction$outboundSchema: z.ZodType< - DefinitionTransaction$Outbound, - z.ZodTypeDef, - DefinitionTransaction -> = z.object({ - id: z.string().optional(), - status: TransactionStatus1$outboundSchema.optional(), - errorMessage: z.nullable(z.string()).optional(), -}); +export function DefinitionTransactionToJSONTyped(value?: DefinitionTransaction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function definitionTransactionToJSON( - definitionTransaction: DefinitionTransaction, -): string { - return JSON.stringify( - DefinitionTransaction$outboundSchema.parse(definitionTransaction), - ); + return { + + 'id': value['id'], + 'status': value['status'], + 'errorMessage': value['errorMessage'], + }; } -export function definitionTransactionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => DefinitionTransaction$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'DefinitionTransaction' from JSON`, - ); + + +export interface ExpensesSyncWebhookDefinitionTransaction { + /** + * Unique identifier of the transaction. + * @type {string} + * @memberof DefinitionTransaction + */ + id?: string; + /** + * Status of transaction. + * @type {string} + * @memberof DefinitionTransaction + */ + status?: TransactionStatus1; + /** + * Error message for failed transaction. + * @type {string} + * @memberof DefinitionTransaction + */ + errorMessage?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/errorvalidation.ts b/sync-for-expenses/src/sdk/models/shared/errorvalidation.ts index dc97b86b1..890f21576 100644 --- a/sync-for-expenses/src/sdk/models/shared/errorvalidation.ts +++ b/sync-for-expenses/src/sdk/models/shared/errorvalidation.ts @@ -1,40 +1,96 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ErrorValidationItem } from './errorvalidationitem'; import { - ErrorValidationItem, - ErrorValidationItem$inboundSchema, -} from "./errorvalidationitem.js"; + ErrorValidationItemFromJSON, + ErrorValidationItemFromJSONTyped, + ErrorValidationItemToJSON, + ErrorValidationItemToJSONTyped, +} from './errorvalidationitem'; /** * A human-readable object describing validation decisions Codat has made. If an operation has failed because of validation errors, they will be detailed here. + * @export + * @interface ErrorValidation + */ +export interface ErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the ErrorValidation interface. */ -export type ErrorValidation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const ErrorValidation$inboundSchema: z.ZodType< - ErrorValidation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), - warnings: z.nullable(z.array(ErrorValidationItem$inboundSchema)).optional(), -}); - -export function errorValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidation' from JSON`, - ); +export function instanceOfErrorValidation(value: object): value is ErrorValidation { + return true; +} + +export function ErrorValidationFromJSON(json: any): ErrorValidation { + return ErrorValidationFromJSONTyped(json, false); +} + +export function ErrorValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ErrorValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ErrorValidationItemFromJSON)), + }; +} + +export function ErrorValidationToJSON(json: any): ErrorValidation { + return ErrorValidationToJSONTyped(json, false); +} + +export function ErrorValidationToJSONTyped(value?: ErrorValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ErrorValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ErrorValidationItemToJSON)), + }; +} + + +export interface ErrorMessageErrorValidation { + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof ErrorValidation + */ + warnings?: Array | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/errorvalidationitem.ts b/sync-for-expenses/src/sdk/models/shared/errorvalidationitem.ts index cd21ec230..c16092788 100644 --- a/sync-for-expenses/src/sdk/models/shared/errorvalidationitem.ts +++ b/sync-for-expenses/src/sdk/models/shared/errorvalidationitem.ts @@ -1,44 +1,102 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ErrorValidationItem = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ErrorValidationItem$inboundSchema: z.ZodType< - ErrorValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function errorValidationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ErrorValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ErrorValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ErrorValidationItem + */ +export interface ErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ErrorValidationItem interface. + */ +export function instanceOfErrorValidationItem(value: object): value is ErrorValidationItem { + return true; +} + +export function ErrorValidationItemFromJSON(json: any): ErrorValidationItem { + return ErrorValidationItemFromJSONTyped(json, false); +} + +export function ErrorValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ErrorValidationItem { + if (json == null) { + return json; + } + return { + + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ErrorValidationItemToJSON(json: any): ErrorValidationItem { + return ErrorValidationItemToJSONTyped(json, false); +} + +export function ErrorValidationItemToJSONTyped(value?: ErrorValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface ErrorMessageErrorValidationItem { + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ErrorValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ErrorValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ErrorValidationItem + */ + validatorName?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/expensecontactref.ts b/sync-for-expenses/src/sdk/models/shared/expensecontactref.ts index 70e6d0f30..845878a43 100644 --- a/sync-for-expenses/src/sdk/models/shared/expensecontactref.ts +++ b/sync-for-expenses/src/sdk/models/shared/expensecontactref.ts @@ -1,57 +1,236 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; +import type { ExpenseContactRefType } from '../_speakeasy_enums'; +import type { Supplier } from './supplier'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ExpenseContactRef + */ +export interface ExpenseContactRef { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + /** - * The type of contact. + * @export */ -export const ExpenseContactRefType = { - Supplier: "Supplier", +export const ExpenseContactRefTypeEnum = { + Supplier: 'Supplier' } as const; +export type ExpenseContactRefTypeEnum = typeof ExpenseContactRefTypeEnum[keyof typeof ExpenseContactRefTypeEnum]; + + /** - * The type of contact. + * Check if a given object implements the ExpenseContactRef interface. */ -export type ExpenseContactRefType = ClosedEnum; - -export type ExpenseContactRef = { - /** - * Identifier of supplier or customer. - */ - id: string; - /** - * The type of contact. - */ - type?: ExpenseContactRefType | undefined; -}; - -/** @internal */ -export const ExpenseContactRefType$outboundSchema: z.ZodNativeEnum< - typeof ExpenseContactRefType -> = z.nativeEnum(ExpenseContactRefType); - -/** @internal */ -export type ExpenseContactRef$Outbound = { - id: string; - type: string; -}; - -/** @internal */ -export const ExpenseContactRef$outboundSchema: z.ZodType< - ExpenseContactRef$Outbound, - z.ZodTypeDef, - ExpenseContactRef -> = z.object({ - id: z.string(), - type: ExpenseContactRefType$outboundSchema.default("Supplier"), -}); - -export function expenseContactRefToJSON( - expenseContactRef: ExpenseContactRef, -): string { - return JSON.stringify( - ExpenseContactRef$outboundSchema.parse(expenseContactRef), - ); +export function instanceOfExpenseContactRef(value: object): value is ExpenseContactRef { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function ExpenseContactRefFromJSON(json: any): ExpenseContactRef { + return ExpenseContactRefFromJSONTyped(json, false); +} + +export function ExpenseContactRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExpenseContactRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'type': json['type'] == null ? undefined : json['type'], + }; +} + +export function ExpenseContactRefToJSON(json: any): ExpenseContactRef { + return ExpenseContactRefToJSONTyped(json, false); +} + +export function ExpenseContactRefToJSONTyped(value?: ExpenseContactRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'type': value['type'], + }; +} + + +export interface CreateExpenseRequestExpenseContactRef { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface CreateExpenseRequestSupplierCustomerReference { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface ExpenseContactRefSupplierCustomerReference { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface ExpenseTransactionExpenseContactRef { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface ExpenseTransactionSupplierCustomerReference { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface SupplierCustomerReference { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface UpdateExpenseRequestExpenseContactRef { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface UpdateExpenseRequestSupplierCustomerReference { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface UpdatingExpenseTransactionRequestExpenseContactRef { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; +} + +export interface UpdatingExpenseTransactionRequestSupplierCustomerReference { + /** + * Identifier of supplier or customer. + * @type {string} + * @memberof ExpenseContactRef + */ + id: string; + /** + * The type of contact. + * @type {string} + * @memberof ExpenseContactRef + */ + type?: ExpenseContactRefType; } diff --git a/sync-for-expenses/src/sdk/models/shared/expensessyncwebhook.ts b/sync-for-expenses/src/sdk/models/shared/expensessyncwebhook.ts index 850b509a3..d8699c70c 100644 --- a/sync-for-expenses/src/sdk/models/shared/expensessyncwebhook.ts +++ b/sync-for-expenses/src/sdk/models/shared/expensessyncwebhook.ts @@ -1,96 +1,97 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ExpensesSyncWebhookPayload } from './expensessyncwebhookpayload'; import { - ExpensesSyncWebhookPayload, - ExpensesSyncWebhookPayload$inboundSchema, - ExpensesSyncWebhookPayload$Outbound, - ExpensesSyncWebhookPayload$outboundSchema, -} from "./expensessyncwebhookpayload.js"; + ExpensesSyncWebhookPayloadFromJSON, + ExpensesSyncWebhookPayloadFromJSONTyped, + ExpensesSyncWebhookPayloadToJSON, + ExpensesSyncWebhookPayloadToJSONTyped, +} from './expensessyncwebhookpayload'; -export type ExpensesSyncWebhook = { - /** - * Unique identifier of the event. - */ - id?: string | undefined; - /** - * The type of event. - */ - eventType?: string | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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 | undefined; - payload?: ExpensesSyncWebhookPayload | undefined; -}; +/** + * + * @export + * @interface ExpensesSyncWebhook + */ +export interface ExpensesSyncWebhook { + /** + * Unique identifier of the event. + * @type {string} + * @memberof ExpensesSyncWebhook + */ + id?: string; + /** + * The type of event. + * @type {string} + * @memberof ExpensesSyncWebhook + */ + eventType?: string; + /** + * The date time in UTC the event was generated in Codat. + * @type {string} + * @memberof ExpensesSyncWebhook + */ + generatedDate?: string; + /** + * + * @type {ExpensesSyncWebhookPayload} + * @memberof ExpensesSyncWebhook + */ + payload?: ExpensesSyncWebhookPayload; +} + +/** + * Check if a given object implements the ExpensesSyncWebhook interface. + */ +export function instanceOfExpensesSyncWebhook(value: object): value is ExpensesSyncWebhook { + return true; +} -/** @internal */ -export const ExpensesSyncWebhook$inboundSchema: z.ZodType< - ExpensesSyncWebhook, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ExpensesSyncWebhookPayload$inboundSchema.optional(), -}); -/** @internal */ -export type ExpensesSyncWebhook$Outbound = { - id?: string | undefined; - eventType?: string | undefined; - generatedDate?: string | undefined; - payload?: ExpensesSyncWebhookPayload$Outbound | undefined; -}; +export function ExpensesSyncWebhookFromJSON(json: any): ExpensesSyncWebhook { + return ExpensesSyncWebhookFromJSONTyped(json, false); +} -/** @internal */ -export const ExpensesSyncWebhook$outboundSchema: z.ZodType< - ExpensesSyncWebhook$Outbound, - z.ZodTypeDef, - ExpensesSyncWebhook -> = z.object({ - id: z.string().optional(), - eventType: z.string().optional(), - generatedDate: z.string().optional(), - payload: ExpensesSyncWebhookPayload$outboundSchema.optional(), -}); +export function ExpensesSyncWebhookFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExpensesSyncWebhook { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'eventType': json['eventType'] == null ? undefined : json['eventType'], + 'generatedDate': json['generatedDate'] == null ? undefined : json['generatedDate'], + 'payload': json['payload'] == null ? undefined : ExpensesSyncWebhookPayloadFromJSON(json['payload']), + }; +} -export function expensesSyncWebhookToJSON( - expensesSyncWebhook: ExpensesSyncWebhook, -): string { - return JSON.stringify( - ExpensesSyncWebhook$outboundSchema.parse(expensesSyncWebhook), - ); +export function ExpensesSyncWebhookToJSON(json: any): ExpensesSyncWebhook { + return ExpensesSyncWebhookToJSONTyped(json, false); } -export function expensesSyncWebhookFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ExpensesSyncWebhook$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ExpensesSyncWebhook' from JSON`, - ); + +export function ExpensesSyncWebhookToJSONTyped(value?: ExpensesSyncWebhook | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'eventType': value['eventType'], + 'generatedDate': value['generatedDate'], + 'payload': ExpensesSyncWebhookPayloadToJSON(value['payload']), + }; } + diff --git a/sync-for-expenses/src/sdk/models/shared/expensessyncwebhookpayload.ts b/sync-for-expenses/src/sdk/models/shared/expensessyncwebhookpayload.ts index e0777d0ac..9836730ae 100644 --- a/sync-for-expenses/src/sdk/models/shared/expensessyncwebhookpayload.ts +++ b/sync-for-expenses/src/sdk/models/shared/expensessyncwebhookpayload.ts @@ -1,74 +1,117 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { DefinitionTransaction } from './definitiontransaction'; import { - CompanyReference, - CompanyReference$inboundSchema, - CompanyReference$Outbound, - CompanyReference$outboundSchema, -} from "./companyreference.js"; + DefinitionTransactionFromJSON, + DefinitionTransactionFromJSONTyped, + DefinitionTransactionToJSON, + DefinitionTransactionToJSONTyped, +} from './definitiontransaction'; +import type { CompanyReference } from './companyreference'; import { - DefinitionTransaction, - DefinitionTransaction$inboundSchema, - DefinitionTransaction$Outbound, - DefinitionTransaction$outboundSchema, -} from "./definitiontransaction.js"; + CompanyReferenceFromJSON, + CompanyReferenceFromJSONTyped, + CompanyReferenceToJSON, + CompanyReferenceToJSONTyped, +} from './companyreference'; -export type ExpensesSyncWebhookPayload = { - referenceCompany?: CompanyReference | undefined; - /** - * Unique identifier of the sync. - */ - syncId?: string | undefined; - transactions?: Array | undefined; -}; +/** + * + * @export + * @interface ExpensesSyncWebhookPayload + */ +export interface ExpensesSyncWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof ExpensesSyncWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof ExpensesSyncWebhookPayload + */ + syncId?: string; + /** + * + * @type {Array} + * @memberof ExpensesSyncWebhookPayload + */ + transactions?: Array; +} + +/** + * Check if a given object implements the ExpensesSyncWebhookPayload interface. + */ +export function instanceOfExpensesSyncWebhookPayload(value: object): value is ExpensesSyncWebhookPayload { + return true; +} + +export function ExpensesSyncWebhookPayloadFromJSON(json: any): ExpensesSyncWebhookPayload { + return ExpensesSyncWebhookPayloadFromJSONTyped(json, false); +} + +export function ExpensesSyncWebhookPayloadFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExpensesSyncWebhookPayload { + if (json == null) { + return json; + } + return { + + 'referenceCompany': json['referenceCompany'] == null ? undefined : CompanyReferenceFromJSON(json['referenceCompany']), + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + 'transactions': json['transactions'] == null ? undefined : ((json['transactions'] as Array).map(DefinitionTransactionFromJSON)), + }; +} -/** @internal */ -export const ExpensesSyncWebhookPayload$inboundSchema: z.ZodType< - ExpensesSyncWebhookPayload, - z.ZodTypeDef, - unknown -> = z.object({ - referenceCompany: CompanyReference$inboundSchema.optional(), - syncId: z.string().optional(), - transactions: z.array(DefinitionTransaction$inboundSchema).optional(), -}); -/** @internal */ -export type ExpensesSyncWebhookPayload$Outbound = { - referenceCompany?: CompanyReference$Outbound | undefined; - syncId?: string | undefined; - transactions?: Array | undefined; -}; +export function ExpensesSyncWebhookPayloadToJSON(json: any): ExpensesSyncWebhookPayload { + return ExpensesSyncWebhookPayloadToJSONTyped(json, false); +} -/** @internal */ -export const ExpensesSyncWebhookPayload$outboundSchema: z.ZodType< - ExpensesSyncWebhookPayload$Outbound, - z.ZodTypeDef, - ExpensesSyncWebhookPayload -> = z.object({ - referenceCompany: CompanyReference$outboundSchema.optional(), - syncId: z.string().optional(), - transactions: z.array(DefinitionTransaction$outboundSchema).optional(), -}); +export function ExpensesSyncWebhookPayloadToJSONTyped(value?: ExpensesSyncWebhookPayload | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function expensesSyncWebhookPayloadToJSON( - expensesSyncWebhookPayload: ExpensesSyncWebhookPayload, -): string { - return JSON.stringify( - ExpensesSyncWebhookPayload$outboundSchema.parse(expensesSyncWebhookPayload), - ); + return { + + 'referenceCompany': CompanyReferenceToJSON(value['referenceCompany']), + 'syncId': value['syncId'], + 'transactions': value['transactions'] == null ? undefined : ((value['transactions'] as Array).map(DefinitionTransactionToJSON)), + }; } -export function expensesSyncWebhookPayloadFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ExpensesSyncWebhookPayload$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ExpensesSyncWebhookPayload' from JSON`, - ); + + +export interface ExpensesSyncWebhookExpensesSyncWebhookPayload { + /** + * + * @type {CompanyReference} + * @memberof ExpensesSyncWebhookPayload + */ + referenceCompany?: CompanyReference; + /** + * Unique identifier of the sync. + * @type {string} + * @memberof ExpensesSyncWebhookPayload + */ + syncId?: string; + /** + * + * @type {Array} + * @memberof ExpensesSyncWebhookPayload + */ + transactions?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/expensetransaction.ts b/sync-for-expenses/src/sdk/models/shared/expensetransaction.ts index c7d431f6b..e10fcf285 100644 --- a/sync-for-expenses/src/sdk/models/shared/expensetransaction.ts +++ b/sync-for-expenses/src/sdk/models/shared/expensetransaction.ts @@ -1,208 +1,437 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; +import type { Type } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BankAccountReference } from './bankaccountreference'; +import { + BankAccountReferenceFromJSON, + BankAccountReferenceFromJSONTyped, + BankAccountReferenceToJSON, + BankAccountReferenceToJSONTyped, +} from './bankaccountreference'; +import type { ExpenseTransactionLine } from './expensetransactionline'; import { - ExpenseContactRef, - ExpenseContactRef$Outbound, - ExpenseContactRef$outboundSchema, -} from "./expensecontactref.js"; + ExpenseTransactionLineFromJSON, + ExpenseTransactionLineFromJSONTyped, + ExpenseTransactionLineToJSON, + ExpenseTransactionLineToJSONTyped, +} from './expensetransactionline'; +import type { ExpenseContactRef } from './expensecontactref'; import { - ExpenseTransactionLine, - ExpenseTransactionLine$Outbound, - ExpenseTransactionLine$outboundSchema, -} from "./expensetransactionline.js"; + ExpenseContactRefFromJSON, + ExpenseContactRefFromJSONTyped, + ExpenseContactRefToJSON, + ExpenseContactRefToJSONTyped, +} from './expensecontactref'; /** - * The type of transaction. + * + * @export + * @interface ExpenseTransaction */ -export const Type = { - Payment: "Payment", - Refund: "Refund", - Reward: "Reward", - Chargeback: "Chargeback", -} as const; +export interface ExpenseTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + id: string; + /** + * The type of transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + type: Type; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof ExpenseTransaction + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof ExpenseTransaction + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof ExpenseTransaction + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof ExpenseTransaction + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof ExpenseTransaction + */ + bankAccountRef?: BankAccountReference; + /** + * User-friendly reference for the expense transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + reference?: string | null; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof ExpenseTransaction + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof ExpenseTransaction + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + notes?: string; + /** + * This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central. + * @type {boolean} + * @memberof ExpenseTransaction + */ + postAsDraft?: boolean | null; +} + + /** - * The type of transaction. + * @export */ -export type Type = ClosedEnum; +export const ExpenseTransactionTypeEnum = { + Payment: 'Payment', + Refund: 'Refund', + Reward: 'Reward', + Chargeback: 'Chargeback' +} as const; +export type ExpenseTransactionTypeEnum = typeof ExpenseTransactionTypeEnum[keyof typeof ExpenseTransactionTypeEnum]; -export type BankAccountReference = { - /** - * Identifier of the bank account. - */ - id?: string | undefined; -}; -export type ExpenseTransaction = { - /** - * Your unique identifier for the transaction. - */ - id: string; - /** - * The type of transaction. - */ - type: Type; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - issueDate: string; - /** - * Currency the transaction was recorded in. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - contactRef?: ExpenseContactRef | undefined; - bankAccountRef?: BankAccountReference | undefined; - /** - * User-friendly reference for the expense transaction. - */ - reference?: string | null | undefined; - /** - * Name of the merchant where the purchase took place - */ - merchantName?: string | undefined; - /** - * Array of transaction lines. - */ - lines?: Array | undefined; - /** - * Any private, company notes about the transaction. - */ - notes?: string | undefined; - /** - * This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central. - */ - postAsDraft?: boolean | null | undefined; -}; +/** + * Check if a given object implements the ExpenseTransaction interface. + */ +export function instanceOfExpenseTransaction(value: object): value is ExpenseTransaction { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('type' in value) || value['type'] === undefined) return false; + if (!('issueDate' in value) || value['issueDate'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + return true; +} -/** @internal */ -export const Type$outboundSchema: z.ZodNativeEnum = z.nativeEnum( - Type, -); +export function ExpenseTransactionFromJSON(json: any): ExpenseTransaction { + return ExpenseTransactionFromJSONTyped(json, false); +} -/** @internal */ -export type BankAccountReference$Outbound = { - id?: string | undefined; -}; +export function ExpenseTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExpenseTransaction { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'type': json['type'], + 'issueDate': json['issueDate'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'contactRef': json['contactRef'] == null ? undefined : ExpenseContactRefFromJSON(json['contactRef']), + 'bankAccountRef': json['bankAccountRef'] == null ? undefined : BankAccountReferenceFromJSON(json['bankAccountRef']), + 'reference': json['reference'] == null ? undefined : json['reference'], + 'merchantName': json['merchantName'] == null ? undefined : json['merchantName'], + 'lines': json['lines'] == null ? undefined : ((json['lines'] as Array).map(ExpenseTransactionLineFromJSON)), + 'notes': json['notes'] == null ? undefined : json['notes'], + 'postAsDraft': json['postAsDraft'] == null ? undefined : json['postAsDraft'], + }; +} -/** @internal */ -export const BankAccountReference$outboundSchema: z.ZodType< - BankAccountReference$Outbound, - z.ZodTypeDef, - BankAccountReference -> = z.object({ - id: z.string().optional(), -}); +export function ExpenseTransactionToJSON(json: any): ExpenseTransaction { + return ExpenseTransactionToJSONTyped(json, false); +} + +export function ExpenseTransactionToJSONTyped(value?: ExpenseTransaction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } -export function bankAccountReferenceToJSON( - bankAccountReference: BankAccountReference, -): string { - return JSON.stringify( - BankAccountReference$outboundSchema.parse(bankAccountReference), - ); + return { + + 'id': value['id'], + 'type': value['type'], + 'issueDate': value['issueDate'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'contactRef': ExpenseContactRefToJSON(value['contactRef']), + 'bankAccountRef': BankAccountReferenceToJSON(value['bankAccountRef']), + 'reference': value['reference'], + 'merchantName': value['merchantName'], + 'lines': value['lines'] == null ? undefined : ((value['lines'] as Array).map(ExpenseTransactionLineToJSON)), + 'notes': value['notes'], + 'postAsDraft': value['postAsDraft'], + }; } -/** @internal */ -export type ExpenseTransaction$Outbound = { - id: string; - type: string; - issueDate: string; - currency: string; - currencyRate?: number | null | undefined; - contactRef?: ExpenseContactRef$Outbound | undefined; - bankAccountRef?: BankAccountReference$Outbound | undefined; - reference?: string | null | undefined; - merchantName?: string | undefined; - lines?: Array | undefined; - notes?: string | undefined; - postAsDraft?: boolean | null | undefined; -}; -/** @internal */ -export const ExpenseTransaction$outboundSchema: z.ZodType< - ExpenseTransaction$Outbound, - z.ZodTypeDef, - ExpenseTransaction -> = z.object({ - id: z.string(), - type: Type$outboundSchema, - issueDate: z.string(), - currency: z.string(), - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - contactRef: ExpenseContactRef$outboundSchema.optional(), - bankAccountRef: z.lazy(() => BankAccountReference$outboundSchema).optional(), - reference: z.nullable(z.string()).optional(), - merchantName: z.string().optional(), - lines: z.array(ExpenseTransactionLine$outboundSchema).optional(), - notes: z.string().optional(), - postAsDraft: z.nullable(z.boolean()).optional(), -}); +export interface CreateExpenseRequest { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + id: string; + /** + * The type of transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + type: Type; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof ExpenseTransaction + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof ExpenseTransaction + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof ExpenseTransaction + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof ExpenseTransaction + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof ExpenseTransaction + */ + bankAccountRef?: BankAccountReference; + /** + * User-friendly reference for the expense transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + reference?: string | null; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof ExpenseTransaction + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof ExpenseTransaction + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + notes?: string; + /** + * This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central. + * @type {boolean} + * @memberof ExpenseTransaction + */ + postAsDraft?: boolean | null; +} -export function expenseTransactionToJSON( - expenseTransaction: ExpenseTransaction, -): string { - return JSON.stringify( - ExpenseTransaction$outboundSchema.parse(expenseTransaction), - ); +export interface CreateExpenseRequestExpenseTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + id: string; + /** + * The type of transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + type: Type; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof ExpenseTransaction + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof ExpenseTransaction + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof ExpenseTransaction + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof ExpenseTransaction + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof ExpenseTransaction + */ + bankAccountRef?: BankAccountReference; + /** + * User-friendly reference for the expense transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + reference?: string | null; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof ExpenseTransaction + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof ExpenseTransaction + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof ExpenseTransaction + */ + notes?: string; + /** + * This optional property, when set to true, posts the transaction to a drafted state. Note that postAsDraft is only supported in Microsoft Dynamics 365 Business Central. + * @type {boolean} + * @memberof ExpenseTransaction + */ + postAsDraft?: boolean | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/expensetransactionline.ts b/sync-for-expenses/src/sdk/models/shared/expensetransactionline.ts index 4b25bc4d2..1f8e3dd86 100644 --- a/sync-for-expenses/src/sdk/models/shared/expensetransactionline.ts +++ b/sync-for-expenses/src/sdk/models/shared/expensetransactionline.ts @@ -1,83 +1,324 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { RecordRef } from './recordref'; import { - InvoiceTo, - InvoiceTo$Outbound, - InvoiceTo$outboundSchema, -} from "./invoiceto.js"; + RecordRefFromJSON, + RecordRefFromJSONTyped, + RecordRefToJSON, + RecordRefToJSONTyped, +} from './recordref'; +import type { ItemRef } from './itemref'; import { - ItemRef, - ItemRef$Outbound, - ItemRef$outboundSchema, -} from "./itemref.js"; + ItemRefFromJSON, + ItemRefFromJSONTyped, + ItemRefToJSON, + ItemRefToJSONTyped, +} from './itemref'; +import type { TrackingRef } from './trackingref'; import { - RecordRef, - RecordRef$Outbound, - RecordRef$outboundSchema, -} from "./recordref.js"; + TrackingRefFromJSON, + TrackingRefFromJSONTyped, + TrackingRefToJSON, + TrackingRefToJSONTyped, +} from './trackingref'; +import type { InvoiceTo } from './invoiceto'; import { - TrackingRef, - TrackingRef$Outbound, - TrackingRef$outboundSchema, -} from "./trackingref.js"; + InvoiceToFromJSON, + InvoiceToFromJSONTyped, + InvoiceToToJSON, + InvoiceToToJSONTyped, +} from './invoiceto'; -export type ExpenseTransactionLine = { - /** - * Amount of the line, exclusive of tax. - */ - netAmount: Decimal$ | number; - /** - * Amount of tax for the line. - */ - taxAmount?: Decimal$ | number | undefined; - taxRateRef?: RecordRef | undefined; - accountRef?: RecordRef | undefined; - itemRef?: ItemRef | null | undefined; - trackingRefs?: Array | null | undefined; - /** - * Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. - */ - invoiceTo?: InvoiceTo | null | undefined; -}; +/** + * + * @export + * @interface ExpenseTransactionLine + */ +export interface ExpenseTransactionLine { + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} + +/** + * Check if a given object implements the ExpenseTransactionLine interface. + */ +export function instanceOfExpenseTransactionLine(value: object): value is ExpenseTransactionLine { + if (!('netAmount' in value) || value['netAmount'] === undefined) return false; + return true; +} -/** @internal */ -export type ExpenseTransactionLine$Outbound = { - netAmount: number; - taxAmount?: number | undefined; - taxRateRef?: RecordRef$Outbound | undefined; - accountRef?: RecordRef$Outbound | undefined; - itemRef?: ItemRef$Outbound | null | undefined; - trackingRefs?: Array | null | undefined; - invoiceTo?: InvoiceTo$Outbound | null | undefined; -}; +export function ExpenseTransactionLineFromJSON(json: any): ExpenseTransactionLine { + return ExpenseTransactionLineFromJSONTyped(json, false); +} + +export function ExpenseTransactionLineFromJSONTyped(json: any, ignoreDiscriminator: boolean): ExpenseTransactionLine { + if (json == null) { + return json; + } + return { + + 'netAmount': json['netAmount'], + 'taxAmount': json['taxAmount'] == null ? undefined : toDecimal(json['taxAmount']), + 'taxRateRef': json['taxRateRef'] == null ? undefined : RecordRefFromJSON(json['taxRateRef']), + 'accountRef': json['accountRef'] == null ? undefined : RecordRefFromJSON(json['accountRef']), + 'itemRef': json['itemRef'] == null ? undefined : ItemRefFromJSON(json['itemRef']), + 'trackingRefs': json['trackingRefs'] == null ? undefined : ((json['trackingRefs'] as Array).map(TrackingRefFromJSON)), + 'invoiceTo': json['invoiceTo'] == null ? undefined : InvoiceToFromJSON(json['invoiceTo']), + }; +} + +export function ExpenseTransactionLineToJSON(json: any): ExpenseTransactionLine { + return ExpenseTransactionLineToJSONTyped(json, false); +} -/** @internal */ -export const ExpenseTransactionLine$outboundSchema: z.ZodType< - ExpenseTransactionLine$Outbound, - z.ZodTypeDef, - ExpenseTransactionLine -> = z.object({ - netAmount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - taxAmount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - taxRateRef: RecordRef$outboundSchema.optional(), - accountRef: RecordRef$outboundSchema.optional(), - itemRef: z.nullable(ItemRef$outboundSchema).optional(), - trackingRefs: z.nullable(z.array(TrackingRef$outboundSchema)).optional(), - invoiceTo: z.nullable(InvoiceTo$outboundSchema).optional(), -}); +export function ExpenseTransactionLineToJSONTyped(value?: ExpenseTransactionLine | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'netAmount': fromDecimal(value['netAmount']), + 'taxAmount': fromDecimal(value['taxAmount']), + 'taxRateRef': RecordRefToJSON(value['taxRateRef']), + 'accountRef': RecordRefToJSON(value['accountRef']), + 'itemRef': ItemRefToJSON(value['itemRef']), + 'trackingRefs': value['trackingRefs'] == null ? undefined : ((value['trackingRefs'] as Array).map(TrackingRefToJSON)), + 'invoiceTo': InvoiceToToJSON(value['invoiceTo']), + }; +} + + +export interface CreateExpenseRequestExpenseTransactionLine { + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} + +export interface ExpenseTransactionExpenseTransactionLine { + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} + +export interface UpdateExpenseRequestExpenseTransactionLine { + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} -export function expenseTransactionLineToJSON( - expenseTransactionLine: ExpenseTransactionLine, -): string { - return JSON.stringify( - ExpenseTransactionLine$outboundSchema.parse(expenseTransactionLine), - ); +export interface UpdatingExpenseTransactionRequestExpenseTransactionLine { + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/halref.ts b/sync-for-expenses/src/sdk/models/shared/halref.ts index 921d594fb..383614b3f 100644 --- a/sync-for-expenses/src/sdk/models/shared/halref.ts +++ b/sync-for-expenses/src/sdk/models/shared/halref.ts @@ -1,31 +1,272 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type HalRef = { - /** - * Uri hypertext reference. - */ - href?: string | undefined; -}; - -/** @internal */ -export const HalRef$inboundSchema: z.ZodType = z - .object({ - href: z.string().optional(), - }); - -export function halRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => HalRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'HalRef' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface HalRef + */ +export interface HalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +/** + * Check if a given object implements the HalRef interface. + */ +export function instanceOfHalRef(value: object): value is HalRef { + return true; +} + +export function HalRefFromJSON(json: any): HalRef { + return HalRefFromJSONTyped(json, false); +} + +export function HalRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): HalRef { + if (json == null) { + return json; + } + return { + + 'href': json['href'] == null ? undefined : json['href'], + }; +} + +export function HalRefToJSON(json: any): HalRef { + return HalRefToJSONTyped(json, false); +} + +export function HalRefToJSONTyped(value?: HalRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'href': value['href'], + }; +} + + +export interface CompaniesHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CompaniesListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ConnectionsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CustomersHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface CustomersListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListCompaniesResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListConnectionsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListCustomersResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListPullOperationsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListPushOperationsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListSuppliersResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface ListSyncTransactionsResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PaginationInformationHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PagingInfoHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PullOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PullOperationsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PushOperationsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface PushOperationsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface SuppliersHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface SuppliersListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface SyncTransactionsListResponseHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; +} + +export interface TransactionsHalRef { + /** + * Uri hypertext reference. + * @type {string} + * @memberof HalRef + */ + href?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/index.ts b/sync-for-expenses/src/sdk/models/shared/index.ts index 9a07f8d88..3e3a2d3d9 100644 --- a/sync-for-expenses/src/sdk/models/shared/index.ts +++ b/sync-for-expenses/src/sdk/models/shared/index.ts @@ -1,107 +1,132 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export * from "./accountingaddresstype.js"; -export * from "./accountmappinginfo.js"; -export * from "./accountprototype.js"; -export * from "./accountstatus.js"; -export * from "./accounttype.js"; -export * from "./adjustmenttransactionline.js"; -export * from "./adjustmenttransactionrequest.js"; -export * from "./adjustmenttransactionresponse.js"; -export * from "./apaccountref.js"; -export * from "./attachment.js"; -export * from "./attachmentupload.js"; -export * from "./bankaccount.js"; -export * from "./bankaccountdetails.js"; -export * from "./bankaccountstatus.js"; -export * from "./clientratelimitwebhook.js"; -export * from "./clientratelimitwebhookpayload.js"; -export * from "./codatfile.js"; -export * from "./companies.js"; -export * from "./company.js"; -export * from "./companyconfiguration.js"; -export * from "./companyinformation.js"; -export * from "./companyreference.js"; -export * from "./companyrequestbody.js"; -export * from "./companysyncstatus.js"; -export * from "./companyupdaterequest.js"; -export * from "./connection.js"; -export * from "./connections.js"; -export * from "./contact.js"; -export * from "./createaccountresponse.js"; -export * from "./createbankaccountresponse.js"; -export * from "./createcustomerresponse.js"; -export * from "./createexpenseresponse.js"; -export * from "./createreimbursableexpenseresponse.js"; -export * from "./createsupplierresponse.js"; -export * from "./customer.js"; -export * from "./customerdetails.js"; -export * from "./customers.js"; -export * from "./customerstatus.js"; -export * from "./dataconnectionerror.js"; -export * from "./dataconnectionstatus.js"; -export * from "./datastatus.js"; -export * from "./datatype.js"; -export * from "./definitiontransaction.js"; -export * from "./errorvalidation.js"; -export * from "./errorvalidationitem.js"; -export * from "./expensecontactref.js"; -export * from "./expensessyncwebhook.js"; -export * from "./expensessyncwebhookpayload.js"; -export * from "./expensetransaction.js"; -export * from "./expensetransactionline.js"; -export * from "./halref.js"; -export * from "./integrationtype.js"; -export * from "./invoiceto.js"; -export * from "./itemref.js"; -export * from "./items.js"; -export * from "./links.js"; -export * from "./mappingoptions.js"; -export * from "./metadata.js"; -export * from "./phonenumberitems.js"; -export * from "./propertiedatatype.js"; -export * from "./pulloperation.js"; -export * from "./pulloperations.js"; -export * from "./pushchangetype.js"; -export * from "./pushfieldvalidation.js"; -export * from "./pushoperation.js"; -export * from "./pushoperationchange.js"; -export * from "./pushoperationref.js"; -export * from "./pushoperations.js"; -export * from "./pushoperationstatus.js"; -export * from "./pushoption.js"; -export * from "./pushoptionchoice.js"; -export * from "./pushoptionproperty.js"; -export * from "./pushoptiontype.js"; -export * from "./pushvalidationinfo.js"; -export * from "./recordref.js"; -export * from "./reimbursableexpensetransaction.js"; -export * from "./reimbursableexpensetransactionline.js"; -export * from "./reimbursementcontactref.js"; -export * from "./security.js"; -export * from "./status.js"; -export * from "./supplementaldata.js"; -export * from "./supplier.js"; -export * from "./supplierdetails.js"; -export * from "./suppliers.js"; -export * from "./supplierstatus.js"; -export * from "./taxratemappinginfo.js"; -export * from "./trackingcategorymappinginfo.js"; -export * from "./trackingref.js"; -export * from "./trackingrefadjustmenttransaction.js"; -export * from "./transaction.js"; -export * from "./transactions.js"; -export * from "./transactionstatus.js"; -export * from "./transfertransactionrequest.js"; -export * from "./transfertransactionresponse.js"; -export * from "./updatecustomerresponse.js"; -export * from "./updateexpenserequest.js"; -export * from "./updateexpenseresponse.js"; -export * from "./updatereimbursableexpensetransactionrequest.js"; -export * from "./updatesupplierresponse.js"; -export * from "./validation.js"; -export * from "./validationitem.js"; -export * from "./validfor.js"; -export * from "./validtransactiontypes.js"; +export * from './accountmappinginfo'; +export * from './accountprototype'; +export * from './accountreference'; +export * from './accountstatus'; +export * from './accounttype'; +export * from './accountingaddress'; +export * from './accountingaddresstype'; +export * from './adjustmenttransactionline'; +export * from './adjustmenttransactionrequest'; +export * from './adjustmenttransactionresponse'; +export * from './apaccountref'; +export * from './attachment'; +export * from './attachmentupload'; +export * from './bankaccount'; +export * from './bankaccountdetails'; +export * from './bankaccountreference'; +export * from './bankaccountstatus'; +export * from './clientratelimitwebhook'; +export * from './clientratelimitwebhookpayload'; +export * from './codatfile'; +export * from './companies'; +export * from './company'; +export * from './companyconfiguration'; +export * from './companyinformation'; +export * from './companyreference'; +export * from './companyreferencelinks'; +export * from './companyrequestbody'; +export * from './companysyncstatus'; +export * from './companyupdaterequest'; +export * from './connection'; +export * from './connections'; +export * from './contact'; +export * from './createaccountresponse'; +export * from './createbankaccountresponse'; +export * from './createcustomerresponse'; +export * from './createexpenseresponse'; +export * from './createreimbursableexpenseresponse'; +export * from './createsupplierresponse'; +export * from './customer'; +export * from './customerdetails'; +export * from './customerstatus'; +export * from './customers'; +export * from './dataconnectionerror'; +export * from './dataconnectionstatus'; +export * from './datastatus'; +export * from './datatype'; +export * from './definitiontransaction'; +export * from './errorvalidation'; +export * from './errorvalidationitem'; +export * from './expensecontactref'; +export * from './expensetransaction'; +export * from './expensetransactionline'; +export * from './expensessyncwebhook'; +export * from './expensessyncwebhookpayload'; +export * from './halref'; +export * from './integrationtype'; +export * from './invoiceto'; +export * from './itemref'; +export * from './items'; +export * from './links'; +export * from './mappingoptions'; +export * from './metadata'; +export * from './phonenumberitems'; +export * from './pulloperation'; +export * from './pulloperations'; +export * from './pushchangetype'; +export * from './pushfieldvalidation'; +export * from './pushoperation'; +export * from './pushoperationchange'; +export * from './pushoperationref'; +export * from './pushoperationstatus'; +export * from './pushoperations'; +export * from './pushoption'; +export * from './pushoptionchoice'; +export * from './pushoptionproperty'; +export * from './pushoptiontype'; +export * from './pushvalidationinfo'; +export * from './recordref'; +export * from './reimbursableexpensetransaction'; +export * from './reimbursableexpensetransactionline'; +export * from './reimbursementcontactref'; +export * from './status'; +export * from './supplementaldata'; +export * from './supplier'; +export * from './supplierdetails'; +export * from './supplierstatus'; +export * from './suppliers'; +export * from './taxratemappinginfo'; +export * from './trackingcategorymappinginfo'; +export * from './trackingref'; +export * from './trackingrefadjustmenttransaction'; +export * from './transaction'; +export * from './transactionstatus'; +export * from './transactions'; +export * from './transfertransactionrequest'; +export * from './transfertransactionresponse'; +export * from './updatecustomerresponse'; +export * from './updateexpenserequest'; +export * from './updateexpenseresponse'; +export * from './updatesupplierresponse'; +export * from './validdatatypelinks'; +export * from './validation'; +export * from './validationitem'; +export * from './weblink'; +export { AccountMappingInfoAccountType } from '../_speakeasy_enums'; +export { AccountingAccount } from '../Account'; +export { BankAccountType } from '../_speakeasy_enums'; +export { CompanyInformationPhoneNumbersType } from '../_speakeasy_enums'; +export { CompanyInformationType } from '../_speakeasy_enums'; +export { CreateBankAccountResponseBankAccountType } from '../_speakeasy_enums'; +export { DataTypes } from '../_speakeasy_enums'; +export { DatasetStatus } from '../_speakeasy_enums'; +export { ErrorStatus } from '../_speakeasy_enums'; +export { ExpenseContactRefType } from '../_speakeasy_enums'; +export { From } from '../TransferTransactionRequestFrom'; +export { InvoiceToType } from '../_speakeasy_enums'; +export { ItemsType } from '../_speakeasy_enums'; +export { PropertieDataType } from '../_speakeasy_enums'; +export { SourceType } from '../_speakeasy_enums'; +export { To } from '../TransferTransactionRequestTo'; +export { TrackingRefAdjustmentTransactionDataType } from '../_speakeasy_enums'; +export { TrackingRefDataType } from '../_speakeasy_enums'; +export { TransactionStatus1 } from '../_speakeasy_enums'; +export { Type } from '../_speakeasy_enums'; +export { UpdateExpenseRequestType } from '../_speakeasy_enums'; +export { UpdateReimbursableExpenseTransactionRequest } from '../UpdateReimbursableExpenseTransactionRequest'; +export { ValidFor } from '../_speakeasy_enums'; +export { ValidTransactionTypes } from '../_speakeasy_enums'; +export type { Security } from '../../../lib/sdkconfig'; diff --git a/sync-for-expenses/src/sdk/models/shared/integrationtype.ts b/sync-for-expenses/src/sdk/models/shared/integrationtype.ts index 405241c43..2a236911f 100644 --- a/sync-for-expenses/src/sdk/models/shared/integrationtype.ts +++ b/sync-for-expenses/src/sdk/models/shared/integrationtype.ts @@ -1,23 +1,53 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Type of transaction that has been processed e.g. Expense or Bank Feed. + * @export */ export const IntegrationType = { - Expenses: "expenses", - Bankfeeds: "bankfeeds", + Expenses: 'expenses', + Bankfeeds: 'bankfeeds' } as const; -/** - * Type of transaction that has been processed e.g. Expense or Bank Feed. - */ -export type IntegrationType = ClosedEnum; +export type IntegrationType = typeof IntegrationType[keyof typeof IntegrationType]; + + +export function instanceOfIntegrationType(value: any): boolean { + for (const key in IntegrationType) { + if (Object.prototype.hasOwnProperty.call(IntegrationType, key)) { + if (IntegrationType[key as keyof typeof IntegrationType] === value) { + return true; + } + } + } + return false; +} + +export function IntegrationTypeFromJSON(json: any): IntegrationType { + return IntegrationTypeFromJSONTyped(json, false); +} + +export function IntegrationTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): IntegrationType { + return json as IntegrationType; +} + +export function IntegrationTypeToJSON(value?: IntegrationType | null): any { + return value as any; +} + +export function IntegrationTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): IntegrationType { + return value as IntegrationType; +} -/** @internal */ -export const IntegrationType$inboundSchema: z.ZodNativeEnum< - typeof IntegrationType -> = z.nativeEnum(IntegrationType); diff --git a/sync-for-expenses/src/sdk/models/shared/invoiceto.ts b/sync-for-expenses/src/sdk/models/shared/invoiceto.ts index 4821b5efc..b5b8ac51a 100644 --- a/sync-for-expenses/src/sdk/models/shared/invoiceto.ts +++ b/sync-for-expenses/src/sdk/models/shared/invoiceto.ts @@ -1,56 +1,415 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - +import type { InvoiceToType } from '../_speakeasy_enums'; +import type { Customer } from './customer'; +import { mapValues } from '../../../runtime'; /** - * The type of contact. + * Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. + * @export + * @interface InvoiceTo */ -export const InvoiceToType = { - Customer: "customer", -} as const; +export interface InvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + + /** - * The type of contact. + * @export */ -export type InvoiceToType = ClosedEnum; +export const InvoiceToTypeEnum = { + Customer: 'customer' +} as const; +export type InvoiceToTypeEnum = typeof InvoiceToTypeEnum[keyof typeof InvoiceToTypeEnum]; + /** - * Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. + * Check if a given object implements the InvoiceTo interface. */ -export type InvoiceTo = { - /** - * identifier of customer. - */ - id?: string | undefined; - /** - * The type of contact. - */ - type?: InvoiceToType | undefined; -}; - -/** @internal */ -export const InvoiceToType$outboundSchema: z.ZodNativeEnum< - typeof InvoiceToType -> = z.nativeEnum(InvoiceToType); - -/** @internal */ -export type InvoiceTo$Outbound = { - id?: string | undefined; - type?: string | undefined; -}; - -/** @internal */ -export const InvoiceTo$outboundSchema: z.ZodType< - InvoiceTo$Outbound, - z.ZodTypeDef, - InvoiceTo -> = z.object({ - id: z.string().optional(), - type: InvoiceToType$outboundSchema.optional(), -}); - -export function invoiceToToJSON(invoiceTo: InvoiceTo): string { - return JSON.stringify(InvoiceTo$outboundSchema.parse(invoiceTo)); +export function instanceOfInvoiceTo(value: object): value is InvoiceTo { + return true; +} + +export function InvoiceToFromJSON(json: any): InvoiceTo { + return InvoiceToFromJSONTyped(json, false); +} + +export function InvoiceToFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvoiceTo { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'type': json['type'] == null ? undefined : json['type'], + }; +} + +export function InvoiceToToJSON(json: any): InvoiceTo { + return InvoiceToToJSONTyped(json, false); +} + +export function InvoiceToToJSONTyped(value?: InvoiceTo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'type': value['type'], + }; +} + + +export interface AdjustmentTransactionBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface AdjustmentTransactionInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface AdjustmentTransactionLineBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface AdjustmentTransactionLineInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface AdjustmentTransactionRequestBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface AdjustmentTransactionRequestInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface BillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface ExpenseTransactionBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface ExpenseTransactionInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface ExpenseTransactionLineBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface ExpenseTransactionLineInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface InvoiceToBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface ReimbursableExpenseTransactionLineBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface ReimbursableExpenseTransactionLineInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdateExpenseRequestBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdateExpenseRequestInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdateReimbursableExpenseTransactionRequestBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdateReimbursableExpenseTransactionRequestInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdatingExpenseTransactionRequestBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdatingExpenseTransactionRequestInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdatingReimbursableExpenseTransactionRequestBillableCustomerReference { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; +} + +export interface UpdatingReimbursableExpenseTransactionRequestInvoiceTo { + /** + * identifier of customer. + * @type {string} + * @memberof InvoiceTo + */ + id?: string; + /** + * The type of contact. + * @type {string} + * @memberof InvoiceTo + */ + type?: InvoiceToType; } diff --git a/sync-for-expenses/src/sdk/models/shared/itemref.ts b/sync-for-expenses/src/sdk/models/shared/itemref.ts index c50859078..ee6e22010 100644 --- a/sync-for-expenses/src/sdk/models/shared/itemref.ts +++ b/sync-for-expenses/src/sdk/models/shared/itemref.ts @@ -1,30 +1,209 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type ItemRef = { - /** - * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. - */ - id?: string | undefined; -}; - -/** @internal */ -export type ItemRef$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const ItemRef$outboundSchema: z.ZodType< - ItemRef$Outbound, - z.ZodTypeDef, - ItemRef -> = z.object({ - id: z.string().optional(), -}); - -export function itemRefToJSON(itemRef: ItemRef): string { - return JSON.stringify(ItemRef$outboundSchema.parse(itemRef)); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ItemRef + */ +export interface ItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +/** + * Check if a given object implements the ItemRef interface. + */ +export function instanceOfItemRef(value: object): value is ItemRef { + return true; +} + +export function ItemRefFromJSON(json: any): ItemRef { + return ItemRefFromJSONTyped(json, false); +} + +export function ItemRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ItemRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function ItemRefToJSON(json: any): ItemRef { + return ItemRefToJSONTyped(json, false); +} + +export function ItemRefToJSONTyped(value?: ItemRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface ExpenseTransactionItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ExpenseTransactionItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ExpenseTransactionLineItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ExpenseTransactionLineItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ItemRefItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ReimbursableExpenseTransactionLineItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface ReimbursableExpenseTransactionLineItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdateExpenseRequestItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdateExpenseRequestItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdatingExpenseTransactionRequestItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdatingExpenseTransactionRequestItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestItemRef { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestItemReference { + /** + * Unique identifier for the item associated with the transaction. The `itemRef` object is currently supported only for QuickBooks Desktop. You can specify either `itemRef` or `accountRef`, but not both. + * @type {string} + * @memberof ItemRef + */ + id?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/items.ts b/sync-for-expenses/src/sdk/models/shared/items.ts index 71bef42e6..2a1890c04 100644 --- a/sync-for-expenses/src/sdk/models/shared/items.ts +++ b/sync-for-expenses/src/sdk/models/shared/items.ts @@ -1,94 +1,664 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { AccountingAddressType } from './accountingaddresstype'; import { - AccountingAddressType, - AccountingAddressType$inboundSchema, - AccountingAddressType$outboundSchema, -} from "./accountingaddresstype.js"; - -export type Items = { - /** - * The type of the address - */ - type: AccountingAddressType; - /** - * Line 1 of the customer address. - */ - line1?: string | null | undefined; - /** - * Line 2 of the customer address. - */ - line2?: string | null | undefined; - /** - * City of the customer address. - */ - city?: string | null | undefined; - /** - * Region of the customer address. - */ - region?: string | null | undefined; - /** - * Country of the customer address. - */ - country?: string | null | undefined; - /** - * Postal code or zip code. - */ - postalCode?: string | null | undefined; -}; - -/** @internal */ -export const Items$inboundSchema: z.ZodType = z - .object({ - type: AccountingAddressType$inboundSchema, - line1: z.nullable(z.string()).optional(), - line2: z.nullable(z.string()).optional(), - city: z.nullable(z.string()).optional(), - region: z.nullable(z.string()).optional(), - country: z.nullable(z.string()).optional(), - postalCode: z.nullable(z.string()).optional(), - }); -/** @internal */ -export type Items$Outbound = { - type: string; - line1?: string | null | undefined; - line2?: string | null | undefined; - city?: string | null | undefined; - region?: string | null | undefined; - country?: string | null | undefined; - postalCode?: string | null | undefined; -}; - -/** @internal */ -export const Items$outboundSchema: z.ZodType< - Items$Outbound, - z.ZodTypeDef, - Items -> = z.object({ - type: AccountingAddressType$outboundSchema, - line1: z.nullable(z.string()).optional(), - line2: z.nullable(z.string()).optional(), - city: z.nullable(z.string()).optional(), - region: z.nullable(z.string()).optional(), - country: z.nullable(z.string()).optional(), - postalCode: z.nullable(z.string()).optional(), -}); - -export function itemsToJSON(items: Items): string { - return JSON.stringify(Items$outboundSchema.parse(items)); -} -export function itemsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Items$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Items' from JSON`, - ); + AccountingAddressTypeFromJSON, + AccountingAddressTypeFromJSONTyped, + AccountingAddressTypeToJSON, + AccountingAddressTypeToJSONTyped, +} from './accountingaddresstype'; + +/** + * + * @export + * @interface Items + */ +export interface Items { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + + + +/** + * Check if a given object implements the Items interface. + */ +export function instanceOfItems(value: object): value is Items { + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function ItemsFromJSON(json: any): Items { + return ItemsFromJSONTyped(json, false); +} + +export function ItemsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Items { + if (json == null) { + return json; + } + return { + + 'type': AccountingAddressTypeFromJSON(json['type']), + 'line1': json['line1'] == null ? undefined : json['line1'], + 'line2': json['line2'] == null ? undefined : json['line2'], + 'city': json['city'] == null ? undefined : json['city'], + 'region': json['region'] == null ? undefined : json['region'], + 'country': json['country'] == null ? undefined : json['country'], + 'postalCode': json['postalCode'] == null ? undefined : json['postalCode'], + }; +} + +export function ItemsToJSON(json: any): Items { + return ItemsToJSONTyped(json, false); +} + +export function ItemsToJSONTyped(value?: Items | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': AccountingAddressTypeToJSON(value['type']), + 'line1': value['line1'], + 'line2': value['line2'], + 'city': value['city'], + 'region': value['region'], + 'country': value['country'], + 'postalCode': value['postalCode'], + }; +} + + +export interface AccountingCustomerItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface AccountingSupplierItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface CreateCustomerResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface CreateSupplierResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface CustomerGetResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface CustomerItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface GetCustomerResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface GetSupplierResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface SupplierGetResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface SupplierItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface UpdateCustomerResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; +} + +export interface UpdateSupplierResponseItems { + /** + * + * @type {AccountingAddressType} + * @memberof Items + */ + type: AccountingAddressType; + /** + * Line 1 of the customer address. + * @type {string} + * @memberof Items + */ + line1?: string; + /** + * Line 2 of the customer address. + * @type {string} + * @memberof Items + */ + line2?: string; + /** + * City of the customer address. + * @type {string} + * @memberof Items + */ + city?: string; + /** + * Region of the customer address. + * @type {string} + * @memberof Items + */ + region?: string; + /** + * Country of the customer address. + * @type {string} + * @memberof Items + */ + country?: string; + /** + * Postal code or zip code. + * @type {string} + * @memberof Items + */ + postalCode?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/links.ts b/sync-for-expenses/src/sdk/models/shared/links.ts index 751d7d00e..527bb63ee 100644 --- a/sync-for-expenses/src/sdk/models/shared/links.ts +++ b/sync-for-expenses/src/sdk/models/shared/links.ts @@ -1,35 +1,720 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { HalRef, HalRef$inboundSchema } from "./halref.js"; - -export type Links = { - self: HalRef; - current: HalRef; - next?: HalRef | undefined; - previous?: HalRef | undefined; -}; - -/** @internal */ -export const Links$inboundSchema: z.ZodType = z - .object({ - self: HalRef$inboundSchema, - current: HalRef$inboundSchema, - next: HalRef$inboundSchema.optional(), - previous: HalRef$inboundSchema.optional(), - }); - -export function linksFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Links$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Links' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { HalRef } from './halref'; +import { + HalRefFromJSON, + HalRefFromJSONTyped, + HalRefToJSON, + HalRefToJSONTyped, +} from './halref'; + +/** + * + * @export + * @interface Links + */ +export interface Links { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +/** + * Check if a given object implements the Links interface. + */ +export function instanceOfLinks(value: object): value is Links { + if (!('self' in value) || value['self'] === undefined) return false; + if (!('current' in value) || value['current'] === undefined) return false; + return true; +} + +export function LinksFromJSON(json: any): Links { + return LinksFromJSONTyped(json, false); +} + +export function LinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): Links { + if (json == null) { + return json; + } + return { + + 'self': HalRefFromJSON(json['self']), + 'current': HalRefFromJSON(json['current']), + 'next': json['next'] == null ? undefined : HalRefFromJSON(json['next']), + 'previous': json['previous'] == null ? undefined : HalRefFromJSON(json['previous']), + }; +} + +export function LinksToJSON(json: any): Links { + return LinksToJSONTyped(json, false); +} + +export function LinksToJSONTyped(value?: Links | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'self': HalRefToJSON(value['self']), + 'current': HalRefToJSON(value['current']), + 'next': HalRefToJSON(value['next']), + 'previous': HalRefToJSON(value['previous']), + }; +} + + +export interface CompaniesLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CompaniesListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ConnectionsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CustomersLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface CustomersListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListCompaniesResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListConnectionsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListCustomersResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListPullOperationsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListPushOperationsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListSuppliersResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface ListSyncTransactionsResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PaginationInformationLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PagingInfoLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PullOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PullOperationsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PushOperationsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface PushOperationsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface SuppliersLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface SuppliersListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface SyncTransactionsListResponseLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; +} + +export interface TransactionsLinks { + /** + * + * @type {HalRef} + * @memberof Links + */ + self: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + current: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + next?: HalRef; + /** + * + * @type {HalRef} + * @memberof Links + */ + previous?: HalRef; } diff --git a/sync-for-expenses/src/sdk/models/shared/mappingoptions.ts b/sync-for-expenses/src/sdk/models/shared/mappingoptions.ts index c4cdff83d..c2fe1cb71 100644 --- a/sync-for-expenses/src/sdk/models/shared/mappingoptions.ts +++ b/sync-for-expenses/src/sdk/models/shared/mappingoptions.ts @@ -1,63 +1,170 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { TaxRateMappingInfo } from './taxratemappinginfo'; import { - AccountMappingInfo, - AccountMappingInfo$inboundSchema, -} from "./accountmappinginfo.js"; + TaxRateMappingInfoFromJSON, + TaxRateMappingInfoFromJSONTyped, + TaxRateMappingInfoToJSON, + TaxRateMappingInfoToJSONTyped, +} from './taxratemappinginfo'; +import type { TrackingCategoryMappingInfo } from './trackingcategorymappinginfo'; import { - TaxRateMappingInfo, - TaxRateMappingInfo$inboundSchema, -} from "./taxratemappinginfo.js"; + TrackingCategoryMappingInfoFromJSON, + TrackingCategoryMappingInfoFromJSONTyped, + TrackingCategoryMappingInfoToJSON, + TrackingCategoryMappingInfoToJSONTyped, +} from './trackingcategorymappinginfo'; +import type { AccountMappingInfo } from './accountmappinginfo'; import { - TrackingCategoryMappingInfo, - TrackingCategoryMappingInfo$inboundSchema, -} from "./trackingcategorymappinginfo.js"; - -export type MappingOptions = { - /** - * Name of the expense integration. - */ - expenseProvider?: string | null | undefined; - /** - * Array of available accounts for mapping. - */ - accounts?: Array | null | undefined; - /** - * Array of available tracking categories for mapping. - */ - trackingCategories?: Array | null | undefined; - /** - * Array of available tax rates for mapping. - */ - taxRates?: Array | null | undefined; -}; - -/** @internal */ -export const MappingOptions$inboundSchema: z.ZodType< - MappingOptions, - z.ZodTypeDef, - unknown -> = z.object({ - expenseProvider: z.nullable(z.string()).optional(), - accounts: z.nullable(z.array(AccountMappingInfo$inboundSchema)).optional(), - trackingCategories: z.nullable( - z.array(TrackingCategoryMappingInfo$inboundSchema), - ).optional(), - taxRates: z.nullable(z.array(TaxRateMappingInfo$inboundSchema)).optional(), -}); - -export function mappingOptionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => MappingOptions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'MappingOptions' from JSON`, - ); + AccountMappingInfoFromJSON, + AccountMappingInfoFromJSONTyped, + AccountMappingInfoToJSON, + AccountMappingInfoToJSONTyped, +} from './accountmappinginfo'; + +/** + * + * @export + * @interface MappingOptions + */ +export interface MappingOptions { + [key: string]: any | any; + /** + * Name of the expense integration. + * @type {string} + * @memberof MappingOptions + */ + expenseProvider?: string | null; + /** + * Array of available accounts for mapping. + * @type {Array} + * @memberof MappingOptions + */ + accounts?: Array | null; + /** + * Array of available tracking categories for mapping. + * @type {Array} + * @memberof MappingOptions + */ + trackingCategories?: Array | null; + /** + * Array of available tax rates for mapping. + * @type {Array} + * @memberof MappingOptions + */ + taxRates?: Array | null; +} + +/** + * Check if a given object implements the MappingOptions interface. + */ +export function instanceOfMappingOptions(value: object): value is MappingOptions { + return true; +} + +export function MappingOptionsFromJSON(json: any): MappingOptions { + return MappingOptionsFromJSONTyped(json, false); +} + +export function MappingOptionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): MappingOptions { + if (json == null) { + return json; + } + return { + + ...json, + 'expenseProvider': json['expenseProvider'] == null ? undefined : json['expenseProvider'], + 'accounts': json['accounts'] == null ? undefined : ((json['accounts'] as Array).map(AccountMappingInfoFromJSON)), + 'trackingCategories': json['trackingCategories'] == null ? undefined : ((json['trackingCategories'] as Array).map(TrackingCategoryMappingInfoFromJSON)), + 'taxRates': json['taxRates'] == null ? undefined : ((json['taxRates'] as Array).map(TaxRateMappingInfoFromJSON)), + }; +} + +export function MappingOptionsToJSON(json: any): MappingOptions { + return MappingOptionsToJSONTyped(json, false); +} + +export function MappingOptionsToJSONTyped(value?: MappingOptions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'expenseProvider': value['expenseProvider'], + 'accounts': value['accounts'] == null ? undefined : ((value['accounts'] as Array).map(AccountMappingInfoToJSON)), + 'trackingCategories': value['trackingCategories'] == null ? undefined : ((value['trackingCategories'] as Array).map(TrackingCategoryMappingInfoToJSON)), + 'taxRates': value['taxRates'] == null ? undefined : ((value['taxRates'] as Array).map(TaxRateMappingInfoToJSON)), + }; +} + + +export interface GetMappingOptionsResponseMappingOptions { + [key: string]: any | any; + /** + * Name of the expense integration. + * @type {string} + * @memberof MappingOptions + */ + expenseProvider?: string | null; + /** + * Array of available accounts for mapping. + * @type {Array} + * @memberof MappingOptions + */ + accounts?: Array | null; + /** + * Array of available tracking categories for mapping. + * @type {Array} + * @memberof MappingOptions + */ + trackingCategories?: Array | null; + /** + * Array of available tax rates for mapping. + * @type {Array} + * @memberof MappingOptions + */ + taxRates?: Array | null; +} + +export interface MappingOptionsGetResponseMappingOptions { + [key: string]: any | any; + /** + * Name of the expense integration. + * @type {string} + * @memberof MappingOptions + */ + expenseProvider?: string | null; + /** + * Array of available accounts for mapping. + * @type {Array} + * @memberof MappingOptions + */ + accounts?: Array | null; + /** + * Array of available tracking categories for mapping. + * @type {Array} + * @memberof MappingOptions + */ + trackingCategories?: Array | null; + /** + * Array of available tax rates for mapping. + * @type {Array} + * @memberof MappingOptions + */ + taxRates?: Array | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/metadata.ts b/sync-for-expenses/src/sdk/models/shared/metadata.ts index 4a678ba93..0b2dbcbf3 100644 --- a/sync-for-expenses/src/sdk/models/shared/metadata.ts +++ b/sync-for-expenses/src/sdk/models/shared/metadata.ts @@ -1,50 +1,299 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type Metadata = { - /** - * Indicates whether the record has been deleted in the third-party system this record originated from. - */ - isDeleted?: boolean | null | undefined; -}; - -/** @internal */ -export const Metadata$inboundSchema: z.ZodType< - Metadata, - z.ZodTypeDef, - unknown -> = z.object({ - isDeleted: z.nullable(z.boolean()).optional(), -}); -/** @internal */ -export type Metadata$Outbound = { - isDeleted?: boolean | null | undefined; -}; - -/** @internal */ -export const Metadata$outboundSchema: z.ZodType< - Metadata$Outbound, - z.ZodTypeDef, - Metadata -> = z.object({ - isDeleted: z.nullable(z.boolean()).optional(), -}); - -export function metadataToJSON(metadata: Metadata): string { - return JSON.stringify(Metadata$outboundSchema.parse(metadata)); -} -export function metadataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Metadata$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Metadata' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface Metadata + */ +export interface Metadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +/** + * Check if a given object implements the Metadata interface. + */ +export function instanceOfMetadata(value: object): value is Metadata { + return true; +} + +export function MetadataFromJSON(json: any): Metadata { + return MetadataFromJSONTyped(json, false); +} + +export function MetadataFromJSONTyped(json: any, ignoreDiscriminator: boolean): Metadata { + if (json == null) { + return json; + } + return { + + 'isDeleted': json['isDeleted'] == null ? undefined : json['isDeleted'], + }; +} + +export function MetadataToJSON(json: any): Metadata { + return MetadataToJSONTyped(json, false); +} + +export function MetadataToJSONTyped(value?: Metadata | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'isDeleted': value['isDeleted'], + }; +} + + +export interface AccountCreateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface AccountMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface AccountingAccountMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface AccountingBankAccountMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface AccountingCustomerMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface AccountingSupplierMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface BankAccountCreateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface BankAccountMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CreateAccountResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CreateBankAccountResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CreateCustomerResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CreateSupplierResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CustomerCreateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CustomerGetResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CustomerMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CustomerUpdateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface CustomersMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface GetCustomerResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface GetSupplierResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface SupplierCreateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface SupplierGetResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface SupplierMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface SupplierUpdateResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface SuppliersMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface UpdateCustomerResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; +} + +export interface UpdateSupplierResponseMetadata { + /** + * Indicates whether the record has been deleted in the third-party system this record originated from. + * @type {boolean} + * @memberof Metadata + */ + isDeleted?: boolean | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/phonenumberitems.ts b/sync-for-expenses/src/sdk/models/shared/phonenumberitems.ts index 25b171809..55074842f 100644 --- a/sync-for-expenses/src/sdk/models/shared/phonenumberitems.ts +++ b/sync-for-expenses/src/sdk/models/shared/phonenumberitems.ts @@ -1,84 +1,165 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { CompanyInformationPhoneNumbersType } from '../_speakeasy_enums'; +import type { ItemsType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface PhoneNumberItems + */ +export interface PhoneNumberItems { + /** + * A phone number. + * @type {string} + * @memberof PhoneNumberItems + */ + number?: string | null; + /** + * The type of phone number + * @type {string} + * @memberof PhoneNumberItems + */ + type: ItemsType; +} + /** - * The type of phone number + * @export */ -export const ItemsType = { - Primary: "Primary", - Landline: "Landline", - Mobile: "Mobile", - Fax: "Fax", - Unknown: "Unknown", +export const PhoneNumberItemsTypeEnum = { + Primary: 'Primary', + Landline: 'Landline', + Mobile: 'Mobile', + Fax: 'Fax', + Unknown: 'Unknown' } as const; +export type PhoneNumberItemsTypeEnum = typeof PhoneNumberItemsTypeEnum[keyof typeof PhoneNumberItemsTypeEnum]; + + /** - * The type of phone number + * Check if a given object implements the PhoneNumberItems interface. */ -export type ItemsType = ClosedEnum; - -export type PhoneNumberItems = { - /** - * A phone number. - */ - number?: string | null | undefined; - /** - * The type of phone number - */ - type: ItemsType; -}; - -/** @internal */ -export const ItemsType$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(ItemsType); -/** @internal */ -export const ItemsType$outboundSchema: z.ZodNativeEnum = - ItemsType$inboundSchema; - -/** @internal */ -export const PhoneNumberItems$inboundSchema: z.ZodType< - PhoneNumberItems, - z.ZodTypeDef, - unknown -> = z.object({ - number: z.nullable(z.string()).optional(), - type: ItemsType$inboundSchema, -}); -/** @internal */ -export type PhoneNumberItems$Outbound = { - number?: string | null | undefined; - type: string; -}; - -/** @internal */ -export const PhoneNumberItems$outboundSchema: z.ZodType< - PhoneNumberItems$Outbound, - z.ZodTypeDef, - PhoneNumberItems -> = z.object({ - number: z.nullable(z.string()).optional(), - type: ItemsType$outboundSchema, -}); - -export function phoneNumberItemsToJSON( - phoneNumberItems: PhoneNumberItems, -): string { - return JSON.stringify( - PhoneNumberItems$outboundSchema.parse(phoneNumberItems), - ); +export function instanceOfPhoneNumberItems(value: object): value is PhoneNumberItems { + if (!('type' in value) || value['type'] === undefined) return false; + return true; +} + +export function PhoneNumberItemsFromJSON(json: any): PhoneNumberItems { + return PhoneNumberItemsFromJSONTyped(json, false); +} + +export function PhoneNumberItemsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PhoneNumberItems { + if (json == null) { + return json; + } + return { + + 'number': json['number'] == null ? undefined : json['number'], + 'type': json['type'], + }; +} + +export function PhoneNumberItemsToJSON(json: any): PhoneNumberItems { + return PhoneNumberItemsToJSONTyped(json, false); } -export function phoneNumberItemsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PhoneNumberItems$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PhoneNumberItems' from JSON`, - ); + +export function PhoneNumberItemsToJSONTyped(value?: PhoneNumberItems | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'number': value['number'], + 'type': value['type'], + }; +} + + +export interface AccountingCompanyInformationPhoneNumberItems { + /** + * A phone number. + * @type {string} + * @memberof PhoneNumberItems + */ + number?: string | null; + /** + * The type of phone number + * @type {string} + * @memberof PhoneNumberItems + */ + type: ItemsType; +} + +export interface CompanyInfoGetResponsePhoneNumberItems { + /** + * A phone number. + * @type {string} + * @memberof PhoneNumberItems + */ + number?: string | null; + /** + * The type of phone number + * @type {string} + * @memberof PhoneNumberItems + */ + type: ItemsType; +} + +export interface CompanyInformationPhoneNumberItems { + /** + * A phone number. + * @type {string} + * @memberof PhoneNumberItems + */ + number?: string | null; + /** + * The type of phone number + * @type {string} + * @memberof PhoneNumberItems + */ + type: ItemsType; +} + +export interface GetCompanyInfoResponsePhoneNumberItems { + /** + * A phone number. + * @type {string} + * @memberof PhoneNumberItems + */ + number?: string | null; + /** + * The type of phone number + * @type {string} + * @memberof PhoneNumberItems + */ + type: ItemsType; +} + +export interface Phone { + /** + * A phone number. + * @type {string} + * @memberof PhoneNumberItems + */ + number?: string | null; + /** + * The type of phone number + * @type {string} + * @memberof PhoneNumberItems + */ + type: CompanyInformationPhoneNumbersType; } diff --git a/sync-for-expenses/src/sdk/models/shared/propertiedatatype.ts b/sync-for-expenses/src/sdk/models/shared/propertiedatatype.ts deleted file mode 100644 index a71dac4dd..000000000 --- a/sync-for-expenses/src/sdk/models/shared/propertiedatatype.ts +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -/** - * Available data types - */ -export const PropertieDataType = { - AccountTransactions: "accountTransactions", - BalanceSheet: "balanceSheet", - BankAccounts: "bankAccounts", - BankTransactions: "bankTransactions", - BillCreditNotes: "billCreditNotes", - BillPayments: "billPayments", - Bills: "bills", - CashFlowStatement: "cashFlowStatement", - ChartOfAccounts: "chartOfAccounts", - Company: "company", - CreditNotes: "creditNotes", - Customers: "customers", - DirectCosts: "directCosts", - DirectIncomes: "directIncomes", - Invoices: "invoices", - ItemReceipts: "itemReceipts", - Items: "items", - JournalEntries: "journalEntries", - Journals: "journals", - PaymentMethods: "paymentMethods", - Payments: "payments", - ProfitAndLoss: "profitAndLoss", - PurchaseOrders: "purchaseOrders", - SalesOrders: "salesOrders", - Suppliers: "suppliers", - TaxRates: "taxRates", - TrackingCategories: "trackingCategories", - Transfers: "transfers", - BankingAccountBalances: "banking-accountBalances", - BankingAccounts: "banking-accounts", - BankingTransactionCategories: "banking-transactionCategories", - BankingTransactions: "banking-transactions", - CommerceCompanyInfo: "commerce-companyInfo", - CommerceCustomers: "commerce-customers", - CommerceDisputes: "commerce-disputes", - CommerceLocations: "commerce-locations", - CommerceOrders: "commerce-orders", - CommercePaymentMethods: "commerce-paymentMethods", - CommercePayments: "commerce-payments", - CommerceProductCategories: "commerce-productCategories", - CommerceProducts: "commerce-products", - CommerceTaxComponents: "commerce-taxComponents", - CommerceTransactions: "commerce-transactions", -} as const; -/** - * Available data types - */ -export type PropertieDataType = ClosedEnum; - -/** @internal */ -export const PropertieDataType$inboundSchema: z.ZodNativeEnum< - typeof PropertieDataType -> = z.nativeEnum(PropertieDataType); diff --git a/sync-for-expenses/src/sdk/models/shared/pulloperation.ts b/sync-for-expenses/src/sdk/models/shared/pulloperation.ts index 393750368..15916a993 100644 --- a/sync-for-expenses/src/sdk/models/shared/pulloperation.ts +++ b/sync-for-expenses/src/sdk/models/shared/pulloperation.ts @@ -1,168 +1,719 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { ClosedEnum } from "../../types/enums.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +import type { DatasetStatus } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; /** - * The current status of the dataset. + * Information about a queued, in progress or completed pull operation. + * *Formally called `dataset`* + * @export + * @interface PullOperation */ -export const DatasetStatus = { - Initial: "Initial", - Queued: "Queued", - Fetching: "Fetching", - MapQueued: "MapQueued", - Mapping: "Mapping", - Complete: "Complete", - FetchError: "FetchError", - MapError: "MapError", - InternalError: "InternalError", - ProcessingQueued: "ProcessingQueued", - Processing: "Processing", - ProcessingError: "ProcessingError", - ValidationQueued: "ValidationQueued", - Validating: "Validating", - ValidationError: "ValidationError", - AuthError: "AuthError", - Cancelled: "Cancelled", - NotSupported: "NotSupported", - RateLimitError: "RateLimitError", - PermissionsError: "PermissionsError", - PrerequisiteNotMet: "PrerequisiteNotMet", -} as const; +export interface PullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + + /** - * The current status of the dataset. + * @export */ -export type DatasetStatus = ClosedEnum; +export const PullOperationStatusEnum = { + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' +} as const; +export type PullOperationStatusEnum = typeof PullOperationStatusEnum[keyof typeof PullOperationStatusEnum]; + /** - * Information about a queued, in progress or completed pull operation. - * - * @remarks - * *Formally called `dataset`* + * Check if a given object implements the PullOperation interface. */ -export type PullOperation = { - /** - * Unique identifier of the pull operation. - */ - id: string; - /** - * Unique identifier of the company associated to this pull operation. - */ - companyId: string; - /** - * Unique identifier of the connection associated to this pull operation. - */ - connectionId: string; - /** - * The data type you are requesting in a pull operation. - */ - dataType: string; - /** - * The current status of the dataset. - */ - status: DatasetStatus; - /** - * Additional information about the dataset status. - */ - statusDescription?: string | null | undefined; - /** - * A message about a transient or persistent error returned by Codat or the source platform. - */ - errorMessage?: string | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completed?: string | undefined; - /** - * An integer signifying the progress of the pull operation. - */ - progress: number; - /** - * `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. - */ - isCompleted: boolean; - /** - * `True` if the pull operation entered an error state. - */ - isErrored: boolean; -}; - -/** @internal */ -export const DatasetStatus$inboundSchema: z.ZodNativeEnum< - typeof DatasetStatus -> = z.nativeEnum(DatasetStatus); - -/** @internal */ -export const PullOperation$inboundSchema: z.ZodType< - PullOperation, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string(), - companyId: z.string(), - connectionId: z.string(), - dataType: z.string(), - status: DatasetStatus$inboundSchema, - statusDescription: z.nullable(z.string()).optional(), - errorMessage: z.nullable(z.string()).optional(), - requested: z.string(), - completed: z.string().optional(), - progress: z.number().int(), - isCompleted: z.boolean(), - isErrored: z.boolean(), -}); - -export function pullOperationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PullOperation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PullOperation' from JSON`, - ); +export function instanceOfPullOperation(value: object): value is PullOperation { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('connectionId' in value) || value['connectionId'] === undefined) return false; + if (!('dataType' in value) || value['dataType'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('requested' in value) || value['requested'] === undefined) return false; + if (!('progress' in value) || value['progress'] === undefined) return false; + if (!('isCompleted' in value) || value['isCompleted'] === undefined) return false; + if (!('isErrored' in value) || value['isErrored'] === undefined) return false; + return true; +} + +export function PullOperationFromJSON(json: any): PullOperation { + return PullOperationFromJSONTyped(json, false); +} + +export function PullOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperation { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'companyId': json['companyId'], + 'connectionId': json['connectionId'], + 'dataType': json['dataType'], + 'status': json['status'], + 'statusDescription': json['statusDescription'] == null ? undefined : json['statusDescription'], + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'requested': json['requested'], + 'completed': json['completed'] == null ? undefined : json['completed'], + 'progress': json['progress'], + 'isCompleted': json['isCompleted'], + 'isErrored': json['isErrored'], + }; +} + +export function PullOperationToJSON(json: any): PullOperation { + return PullOperationToJSONTyped(json, false); +} + +export function PullOperationToJSONTyped(value?: PullOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'companyId': value['companyId'], + 'connectionId': value['connectionId'], + 'dataType': value['dataType'], + 'status': value['status'], + 'statusDescription': value['statusDescription'], + 'errorMessage': value['errorMessage'], + 'requested': value['requested'], + 'completed': value['completed'], + 'progress': value['progress'], + 'isCompleted': value['isCompleted'], + 'isErrored': value['isErrored'], + }; +} + + +export interface DataTypeRefreshResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface GetPullOperationResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface ListPullOperationsResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface PullOperationGetResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface PullOperationsListResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface PullOperationsPullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; +} + +export interface RefreshDataTypeResponsePullOperation { + /** + * Unique identifier of the pull operation. + * @type {string} + * @memberof PullOperation + */ + id: string; + /** + * Unique identifier of the company associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + companyId: string; + /** + * Unique identifier of the connection associated to this pull operation. + * @type {string} + * @memberof PullOperation + */ + connectionId: string; + /** + * The data type you are requesting in a pull operation. + * @type {string} + * @memberof PullOperation + */ + dataType: string; + /** + * The current status of the dataset. + * @type {string} + * @memberof PullOperation + */ + status: DatasetStatus; + /** + * Additional information about the dataset status. + * @type {string} + * @memberof PullOperation + */ + statusDescription?: string | null; + /** + * A message about a transient or persistent error returned by Codat or the source platform. + * @type {string} + * @memberof PullOperation + */ + errorMessage?: string | null; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + requested: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof PullOperation + */ + completed?: string; + /** + * An integer signifying the progress of the pull operation. + * @type {number} + * @memberof PullOperation + */ + progress: number; + /** + * `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. + * @type {boolean} + * @memberof PullOperation + */ + isCompleted: boolean; + /** + * `True` if the pull operation entered an error state. + * @type {boolean} + * @memberof PullOperation + */ + isErrored: boolean; } diff --git a/sync-for-expenses/src/sdk/models/shared/pulloperations.ts b/sync-for-expenses/src/sdk/models/shared/pulloperations.ts index 475158a00..40783cff9 100644 --- a/sync-for-expenses/src/sdk/models/shared/pulloperations.ts +++ b/sync-for-expenses/src/sdk/models/shared/pulloperations.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { PullOperation, PullOperation$inboundSchema } from "./pulloperation.js"; - -export type PullOperations = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const PullOperations$inboundSchema: z.ZodType< - PullOperations, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(PullOperation$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function pullOperationsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PullOperations$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PullOperations' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { PullOperation } from './pulloperation'; +import { + PullOperationFromJSON, + PullOperationFromJSONTyped, + PullOperationToJSON, + PullOperationToJSONTyped, +} from './pulloperation'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface PullOperations + */ +export interface PullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PullOperations interface. + */ +export function instanceOfPullOperations(value: object): value is PullOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PullOperationsFromJSON(json: any): PullOperations { + return PullOperationsFromJSONTyped(json, false); +} + +export function PullOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PullOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PullOperationFromJSON)), + }; +} + +export function PullOperationsToJSON(json: any): PullOperations { + return PullOperationsToJSONTyped(json, false); +} + +export function PullOperationsToJSONTyped(value?: PullOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PullOperationToJSON)), + }; +} + + +export interface ListPullOperationsResponsePullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; +} + +export interface PullOperationsListResponsePullOperations { + /** + * Current page number. + * @type {number} + * @memberof PullOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PullOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PullOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PullOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PullOperations + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushchangetype.ts b/sync-for-expenses/src/sdk/models/shared/pushchangetype.ts index 42040ea23..f7df0ba1a 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushchangetype.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushchangetype.ts @@ -1,26 +1,56 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Type of change being applied to record in third party platform. + * @export */ export const PushChangeType = { - Unknown: "Unknown", - Created: "Created", - Modified: "Modified", - Deleted: "Deleted", - AttachmentUploaded: "AttachmentUploaded", + Unknown: 'Unknown', + Created: 'Created', + Modified: 'Modified', + Deleted: 'Deleted', + AttachmentUploaded: 'AttachmentUploaded' } as const; -/** - * Type of change being applied to record in third party platform. - */ -export type PushChangeType = ClosedEnum; +export type PushChangeType = typeof PushChangeType[keyof typeof PushChangeType]; + + +export function instanceOfPushChangeType(value: any): boolean { + for (const key in PushChangeType) { + if (Object.prototype.hasOwnProperty.call(PushChangeType, key)) { + if (PushChangeType[key as keyof typeof PushChangeType] === value) { + return true; + } + } + } + return false; +} + +export function PushChangeTypeFromJSON(json: any): PushChangeType { + return PushChangeTypeFromJSONTyped(json, false); +} + +export function PushChangeTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushChangeType { + return json as PushChangeType; +} + +export function PushChangeTypeToJSON(value?: PushChangeType | null): any { + return value as any; +} + +export function PushChangeTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushChangeType { + return value as PushChangeType; +} -/** @internal */ -export const PushChangeType$inboundSchema: z.ZodNativeEnum< - typeof PushChangeType -> = z.nativeEnum(PushChangeType); diff --git a/sync-for-expenses/src/sdk/models/shared/pushfieldvalidation.ts b/sync-for-expenses/src/sdk/models/shared/pushfieldvalidation.ts index 15fc3a0f5..f72b00c45 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushfieldvalidation.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushfieldvalidation.ts @@ -1,44 +1,107 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type PushFieldValidation = { - /** - * Field name that resulted in the validation issue. - */ - field?: string | undefined; - /** - * Details on the validation issue. - */ - details: string; - /** - * Unique reference identifier for the validation issue. - */ - ref?: string | null | undefined; -}; - -/** @internal */ -export const PushFieldValidation$inboundSchema: z.ZodType< - PushFieldValidation, - z.ZodTypeDef, - unknown -> = z.object({ - field: z.string().optional(), - details: z.string(), - ref: z.nullable(z.string()).optional(), -}); - -export function pushFieldValidationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushFieldValidation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushFieldValidation' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface PushFieldValidation + */ +export interface PushFieldValidation { + [key: string]: any | any; + /** + * Field name that resulted in the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + field?: string; + /** + * Details on the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + details: string; + /** + * Unique reference identifier for the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + ref?: string | null; +} + +/** + * Check if a given object implements the PushFieldValidation interface. + */ +export function instanceOfPushFieldValidation(value: object): value is PushFieldValidation { + if (!('details' in value) || value['details'] === undefined) return false; + return true; +} + +export function PushFieldValidationFromJSON(json: any): PushFieldValidation { + return PushFieldValidationFromJSONTyped(json, false); +} + +export function PushFieldValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushFieldValidation { + if (json == null) { + return json; + } + return { + + ...json, + 'field': json['field'] == null ? undefined : json['field'], + 'details': json['details'], + 'ref': json['ref'] == null ? undefined : json['ref'], + }; +} + +export function PushFieldValidationToJSON(json: any): PushFieldValidation { + return PushFieldValidationToJSONTyped(json, false); +} + +export function PushFieldValidationToJSONTyped(value?: PushFieldValidation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'field': value['field'], + 'details': value['details'], + 'ref': value['ref'], + }; +} + + +export interface PushOptionPushFieldValidation { + [key: string]: any | any; + /** + * Field name that resulted in the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + field?: string; + /** + * Details on the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + details: string; + /** + * Unique reference identifier for the validation issue. + * @type {string} + * @memberof PushFieldValidation + */ + ref?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoperation.ts b/sync-for-expenses/src/sdk/models/shared/pushoperation.ts index b9563094c..ec7369ec0 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoperation.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoperation.ts @@ -1,145 +1,1641 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { PushOperationChange } from './pushoperationchange'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; - -export type PushOperation = { - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; - -/** @internal */ -export const PushOperation$inboundSchema: z.ZodType< - PushOperation, - z.ZodTypeDef, - unknown -> = z.object({ - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); - -export function pushOperationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperation' from JSON`, - ); + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; + +/** + * + * @export + * @interface PushOperation + */ +export interface PushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + + +/** + * @export + */ +export const PushOperationDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type PushOperationDataTypeEnum = typeof PushOperationDataTypeEnum[keyof typeof PushOperationDataTypeEnum]; + + +/** + * Check if a given object implements the PushOperation interface. + */ +export function instanceOfPushOperation(value: object): value is PushOperation { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function PushOperationFromJSON(json: any): PushOperation { + return PushOperationFromJSONTyped(json, false); +} + +export function PushOperationFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperation { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + }; +} + +export function PushOperationToJSON(json: any): PushOperation { + return PushOperationToJSONTyped(json, false); +} + +export function PushOperationToJSONTyped(value?: PushOperation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + }; +} + + +export interface AccountCreateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface BankAccountCreateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateAccountResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateBankAccountResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateCustomerResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CreateSupplierResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CustomerCreateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface CustomerUpdateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface GetPushOperationResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface ListPushOperationsResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface PushOperationGetResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface PushOperationsListResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface PushOperationsPushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface SupplierCreateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface SupplierUpdateResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface UpdateCustomerResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; +} + +export interface UpdateSupplierResponsePushOperation { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof PushOperation + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof PushOperation + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof PushOperation + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof PushOperation + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof PushOperation + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof PushOperation + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof PushOperation + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof PushOperation + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof PushOperation + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof PushOperation + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof PushOperation + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof PushOperation + */ + statusCode: number; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoperationchange.ts b/sync-for-expenses/src/sdk/models/shared/pushoperationchange.ts index 5d771700a..f84f910ee 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoperationchange.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoperationchange.ts @@ -1,49 +1,413 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushChangeType } from './pushchangetype'; import { - PushChangeType, - PushChangeType$inboundSchema, -} from "./pushchangetype.js"; + PushChangeTypeFromJSON, + PushChangeTypeFromJSONTyped, + PushChangeTypeToJSON, + PushChangeTypeToJSONTyped, +} from './pushchangetype'; +import type { PushOperationRef } from './pushoperationref'; import { - PushOperationRef, - PushOperationRef$inboundSchema, -} from "./pushoperationref.js"; - -export type PushOperationChange = { - /** - * Type of change being applied to record in third party platform. - */ - type?: PushChangeType | undefined; - recordRef?: PushOperationRef | undefined; - /** - * Unique identifier for the attachment created otherwise null. - */ - attachmentId?: string | null | undefined; -}; - -/** @internal */ -export const PushOperationChange$inboundSchema: z.ZodType< - PushOperationChange, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushChangeType$inboundSchema.optional(), - recordRef: PushOperationRef$inboundSchema.optional(), - attachmentId: z.nullable(z.string()).optional(), -}); - -export function pushOperationChangeFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperationChange$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperationChange' from JSON`, - ); + PushOperationRefFromJSON, + PushOperationRefFromJSONTyped, + PushOperationRefToJSON, + PushOperationRefToJSONTyped, +} from './pushoperationref'; + +/** + * + * @export + * @interface PushOperationChange + */ +export interface PushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + + + +/** + * Check if a given object implements the PushOperationChange interface. + */ +export function instanceOfPushOperationChange(value: object): value is PushOperationChange { + return true; +} + +export function PushOperationChangeFromJSON(json: any): PushOperationChange { + return PushOperationChangeFromJSONTyped(json, false); +} + +export function PushOperationChangeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationChange { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : PushChangeTypeFromJSON(json['type']), + 'recordRef': json['recordRef'] == null ? undefined : PushOperationRefFromJSON(json['recordRef']), + 'attachmentId': json['attachmentId'] == null ? undefined : json['attachmentId'], + }; +} + +export function PushOperationChangeToJSON(json: any): PushOperationChange { + return PushOperationChangeToJSONTyped(json, false); +} + +export function PushOperationChangeToJSONTyped(value?: PushOperationChange | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushChangeTypeToJSON(value['type']), + 'recordRef': PushOperationRefToJSON(value['recordRef']), + 'attachmentId': value['attachmentId'], + }; +} + + +export interface AccountCreateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface BankAccountCreateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateAccountResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateBankAccountResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateCustomerResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CreateSupplierResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CustomerCreateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface CustomerUpdateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface GetPushOperationResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface PushOperationGetResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface PushOperationPushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface SupplierCreateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface SupplierUpdateResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface UpdateCustomerResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; +} + +export interface UpdateSupplierResponsePushOperationChange { + /** + * + * @type {PushChangeType} + * @memberof PushOperationChange + */ + type?: PushChangeType; + /** + * + * @type {PushOperationRef} + * @memberof PushOperationChange + */ + recordRef?: PushOperationRef; + /** + * Unique identifier for the attachment created otherwise null. + * @type {string} + * @memberof PushOperationChange + */ + attachmentId?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoperationref.ts b/sync-for-expenses/src/sdk/models/shared/pushoperationref.ts index 59aa76101..577f28a48 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoperationref.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoperationref.ts @@ -1,43 +1,245 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; - -export type PushOperationRef = { - /** - * Unique identifier for a push operation. - */ - id?: string | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; -}; - -/** @internal */ -export const PushOperationRef$inboundSchema: z.ZodType< - PushOperationRef, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - dataType: PropertieDataType$inboundSchema.optional(), -}); - -export function pushOperationRefFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperationRef$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperationRef' from JSON`, - ); +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface PushOperationRef + */ +export interface PushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + + +/** + * @export + */ +export const PushOperationRefDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type PushOperationRefDataTypeEnum = typeof PushOperationRefDataTypeEnum[keyof typeof PushOperationRefDataTypeEnum]; + + +/** + * Check if a given object implements the PushOperationRef interface. + */ +export function instanceOfPushOperationRef(value: object): value is PushOperationRef { + return true; +} + +export function PushOperationRefFromJSON(json: any): PushOperationRef { + return PushOperationRefFromJSONTyped(json, false); +} + +export function PushOperationRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationRef { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + }; +} + +export function PushOperationRefToJSON(json: any): PushOperationRef { + return PushOperationRefToJSONTyped(json, false); +} + +export function PushOperationRefToJSONTyped(value?: PushOperationRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'dataType': value['dataType'], + }; +} + + +export interface CreateAccountResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + +export interface CreateBankAccountResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + +export interface CreateCustomerResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + +export interface CreateSupplierResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + +export interface PushOperationPushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + +export interface UpdateCustomerResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; +} + +export interface UpdateSupplierResponsePushOperationRef { + [key: string]: any | any; + /** + * Unique identifier for a push operation. + * @type {string} + * @memberof PushOperationRef + */ + id?: string; + /** + * Available data types + * @type {string} + * @memberof PushOperationRef + */ + dataType?: PropertieDataType; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoperations.ts b/sync-for-expenses/src/sdk/models/shared/pushoperations.ts index 35c08c726..f68a312bd 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoperations.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoperations.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { PushOperation, PushOperation$inboundSchema } from "./pushoperation.js"; - -export type PushOperations = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const PushOperations$inboundSchema: z.ZodType< - PushOperations, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(PushOperation$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function pushOperationsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOperations$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOperations' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; +import type { PushOperation } from './pushoperation'; +import { + PushOperationFromJSON, + PushOperationFromJSONTyped, + PushOperationToJSON, + PushOperationToJSONTyped, +} from './pushoperation'; + +/** + * + * @export + * @interface PushOperations + */ +export interface PushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +/** + * Check if a given object implements the PushOperations interface. + */ +export function instanceOfPushOperations(value: object): value is PushOperations { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function PushOperationsFromJSON(json: any): PushOperations { + return PushOperationsFromJSONTyped(json, false); +} + +export function PushOperationsFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperations { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(PushOperationFromJSON)), + }; +} + +export function PushOperationsToJSON(json: any): PushOperations { + return PushOperationsToJSONTyped(json, false); +} + +export function PushOperationsToJSONTyped(value?: PushOperations | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(PushOperationToJSON)), + }; +} + + +export interface ListPushOperationsResponsePushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; +} + +export interface PushOperationsListResponsePushOperations { + /** + * Current page number. + * @type {number} + * @memberof PushOperations + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof PushOperations + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof PushOperations + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof PushOperations + */ + links: Links; + /** + * + * @type {Array} + * @memberof PushOperations + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoperationstatus.ts b/sync-for-expenses/src/sdk/models/shared/pushoperationstatus.ts index 133e3b65f..8b726568f 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoperationstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoperationstatus.ts @@ -1,25 +1,55 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the push operation. + * @export */ export const PushOperationStatus = { - Pending: "Pending", - Failed: "Failed", - Success: "Success", - TimedOut: "TimedOut", + Pending: 'Pending', + Failed: 'Failed', + Success: 'Success', + TimedOut: 'TimedOut' } as const; -/** - * The current status of the push operation. - */ -export type PushOperationStatus = ClosedEnum; +export type PushOperationStatus = typeof PushOperationStatus[keyof typeof PushOperationStatus]; + + +export function instanceOfPushOperationStatus(value: any): boolean { + for (const key in PushOperationStatus) { + if (Object.prototype.hasOwnProperty.call(PushOperationStatus, key)) { + if (PushOperationStatus[key as keyof typeof PushOperationStatus] === value) { + return true; + } + } + } + return false; +} + +export function PushOperationStatusFromJSON(json: any): PushOperationStatus { + return PushOperationStatusFromJSONTyped(json, false); +} + +export function PushOperationStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOperationStatus { + return json as PushOperationStatus; +} + +export function PushOperationStatusToJSON(value?: PushOperationStatus | null): any { + return value as any; +} + +export function PushOperationStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOperationStatus { + return value as PushOperationStatus; +} -/** @internal */ -export const PushOperationStatus$inboundSchema: z.ZodNativeEnum< - typeof PushOperationStatus -> = z.nativeEnum(PushOperationStatus); diff --git a/sync-for-expenses/src/sdk/models/shared/pushoption.ts b/sync-for-expenses/src/sdk/models/shared/pushoption.ts index af6a0a0a3..077589c75 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoption.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoption.ts @@ -1,71 +1,327 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionChoice, - PushOptionChoice$inboundSchema, -} from "./pushoptionchoice.js"; + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; +import type { PushOptionChoice } from './pushoptionchoice'; import { - PushOptionProperty, - PushOptionProperty$inboundSchema, -} from "./pushoptionproperty.js"; + PushOptionChoiceFromJSON, + PushOptionChoiceFromJSONTyped, + PushOptionChoiceToJSON, + PushOptionChoiceToJSONTyped, +} from './pushoptionchoice'; +import type { PushValidationInfo } from './pushvalidationinfo'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; + PushValidationInfoFromJSON, + PushValidationInfoFromJSONTyped, + PushValidationInfoToJSON, + PushValidationInfoToJSONTyped, +} from './pushvalidationinfo'; +import type { PushOptionProperty } from './pushoptionproperty'; import { - PushValidationInfo, - PushValidationInfo$inboundSchema, -} from "./pushvalidationinfo.js"; + PushOptionPropertyFromJSON, + PushOptionPropertyFromJSONTyped, + PushOptionPropertyToJSON, + PushOptionPropertyToJSONTyped, +} from './pushoptionproperty'; -export type PushOption = { - /** - * The option type. - */ - type: PushOptionType; - /** - * The property's display name. - */ - displayName: string; - /** - * A description of the property. - */ - description?: string | undefined; - /** - * The property is required if `True`. - */ - required: boolean; - properties?: { [k: string]: PushOptionProperty } | null | undefined; - options?: Array | null | undefined; - validation?: PushValidationInfo | undefined; -}; +/** + * + * @export + * @interface PushOption + */ +export interface PushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + + + +/** + * Check if a given object implements the PushOption interface. + */ +export function instanceOfPushOption(value: object): value is PushOption { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('required' in value) || value['required'] === undefined) return false; + return true; +} + +export function PushOptionFromJSON(json: any): PushOption { + return PushOptionFromJSONTyped(json, false); +} + +export function PushOptionFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOption { + if (json == null) { + return json; + } + return { + + 'type': PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'], + 'description': json['description'] == null ? undefined : json['description'], + 'required': json['required'], + 'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], PushOptionPropertyFromJSON)), + 'options': json['options'] == null ? undefined : ((json['options'] as Array).map(PushOptionChoiceFromJSON)), + 'validation': json['validation'] == null ? undefined : PushValidationInfoFromJSON(json['validation']), + }; +} -/** @internal */ -export const PushOption$inboundSchema: z.ZodType< - PushOption, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushOptionType$inboundSchema, - displayName: z.string(), - description: z.string().optional(), - required: z.boolean(), - properties: z.nullable(z.record(PushOptionProperty$inboundSchema)).optional(), - options: z.nullable(z.array(PushOptionChoice$inboundSchema)).optional(), - validation: PushValidationInfo$inboundSchema.optional(), -}); +export function PushOptionToJSON(json: any): PushOption { + return PushOptionToJSONTyped(json, false); +} + +export function PushOptionToJSONTyped(value?: PushOption | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + 'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], PushOptionPropertyToJSON)), + 'options': value['options'] == null ? undefined : ((value['options'] as Array).map(PushOptionChoiceToJSON)), + 'validation': PushValidationInfoToJSON(value['validation']), + }; +} + + +export interface CreateBankAccountsModelGetResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + +export interface CreateChartOfAccountsModelGetResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} + +export interface GetCreateBankAccountsModelResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; +} -export function pushOptionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOption$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOption' from JSON`, - ); +export interface GetCreateChartOfAccountsModelResponsePushOption { + /** + * + * @type {PushOptionType} + * @memberof PushOption + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOption + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOption + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOption + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOption + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOption + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOption + */ + validation?: PushValidationInfo; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoptionchoice.ts b/sync-for-expenses/src/sdk/models/shared/pushoptionchoice.ts index 315b39f91..025aec75d 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoptionchoice.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoptionchoice.ts @@ -1,58 +1,272 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; - -export type PushOptionChoice = { - /** - * Allowed value for field. - */ - value?: string | undefined; - /** - * The option type. - */ - type?: PushOptionType | undefined; - /** - * The property's display name. - */ - displayName?: string | undefined; - /** - * A description of the property. - */ - description?: string | undefined; - /** - * The property is required if `True`. - */ - required?: boolean | undefined; -}; - -/** @internal */ -export const PushOptionChoice$inboundSchema: z.ZodType< - PushOptionChoice, - z.ZodTypeDef, - unknown -> = z.object({ - value: z.string().optional(), - type: PushOptionType$inboundSchema.optional(), - displayName: z.string().optional(), - description: z.string().optional(), - required: z.boolean().optional(), -}); - -export function pushOptionChoiceFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOptionChoice$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOptionChoice' from JSON`, - ); + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; + +/** + * + * @export + * @interface PushOptionChoice + */ +export interface PushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + + + +/** + * Check if a given object implements the PushOptionChoice interface. + */ +export function instanceOfPushOptionChoice(value: object): value is PushOptionChoice { + return true; +} + +export function PushOptionChoiceFromJSON(json: any): PushOptionChoice { + return PushOptionChoiceFromJSONTyped(json, false); +} + +export function PushOptionChoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionChoice { + if (json == null) { + return json; + } + return { + + 'value': json['value'] == null ? undefined : json['value'], + 'type': json['type'] == null ? undefined : PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'] == null ? undefined : json['displayName'], + 'description': json['description'] == null ? undefined : json['description'], + 'required': json['required'] == null ? undefined : json['required'], + }; +} + +export function PushOptionChoiceToJSON(json: any): PushOptionChoice { + return PushOptionChoiceToJSONTyped(json, false); +} + +export function PushOptionChoiceToJSONTyped(value?: PushOptionChoice | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'value': value['value'], + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + }; +} + + +export interface CreateBankAccountsModelGetResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface CreateChartOfAccountsModelGetResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface GetCreateBankAccountsModelResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface GetCreateChartOfAccountsModelResponsePushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; +} + +export interface PushOptionPushOptionChoice { + /** + * Allowed value for field. + * @type {string} + * @memberof PushOptionChoice + */ + value?: string; + /** + * + * @type {PushOptionType} + * @memberof PushOptionChoice + */ + type?: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionChoice + */ + displayName?: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionChoice + */ + description?: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionChoice + */ + required?: boolean; } diff --git a/sync-for-expenses/src/sdk/models/shared/pushoptionproperty.ts b/sync-for-expenses/src/sdk/models/shared/pushoptionproperty.ts index 0100bc7b6..4ca6362a9 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoptionproperty.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoptionproperty.ts @@ -1,69 +1,141 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushOptionType } from './pushoptiontype'; import { - PushOptionChoice, - PushOptionChoice$inboundSchema, -} from "./pushoptionchoice.js"; + PushOptionTypeFromJSON, + PushOptionTypeFromJSONTyped, + PushOptionTypeToJSON, + PushOptionTypeToJSONTyped, +} from './pushoptiontype'; +import type { PushOptionChoice } from './pushoptionchoice'; import { - PushOptionType, - PushOptionType$inboundSchema, -} from "./pushoptiontype.js"; + PushOptionChoiceFromJSON, + PushOptionChoiceFromJSONTyped, + PushOptionChoiceToJSON, + PushOptionChoiceToJSONTyped, +} from './pushoptionchoice'; +import type { PushValidationInfo } from './pushvalidationinfo'; import { - PushValidationInfo, - PushValidationInfo$inboundSchema, -} from "./pushvalidationinfo.js"; + PushValidationInfoFromJSON, + PushValidationInfoFromJSONTyped, + PushValidationInfoToJSON, + PushValidationInfoToJSONTyped, +} from './pushvalidationinfo'; -export type PushOptionProperty = { - /** - * The option type. - */ - type: PushOptionType; - /** - * The property's display name. - */ - displayName: string; - /** - * A description of the property. - */ - description: string; - /** - * The property is required if `True`. - */ - required: boolean; - properties?: { [k: string]: PushOptionProperty } | null | undefined; - options?: Array | null | undefined; - validation?: PushValidationInfo | undefined; -}; +/** + * + * @export + * @interface PushOptionProperty + */ +export interface PushOptionProperty { + /** + * + * @type {PushOptionType} + * @memberof PushOptionProperty + */ + type: PushOptionType; + /** + * The property's display name. + * @type {string} + * @memberof PushOptionProperty + */ + displayName: string; + /** + * A description of the property. + * @type {string} + * @memberof PushOptionProperty + */ + description: string; + /** + * The property is required if `True`. + * @type {boolean} + * @memberof PushOptionProperty + */ + required: boolean; + /** + * + * @type {{ [key: string]: PushOptionProperty; }} + * @memberof PushOptionProperty + */ + properties?: { [key: string]: PushOptionProperty; } | null; + /** + * + * @type {Array} + * @memberof PushOptionProperty + */ + options?: Array | null; + /** + * + * @type {PushValidationInfo} + * @memberof PushOptionProperty + */ + validation?: PushValidationInfo; +} + + + +/** + * Check if a given object implements the PushOptionProperty interface. + */ +export function instanceOfPushOptionProperty(value: object): value is PushOptionProperty { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('displayName' in value) || value['displayName'] === undefined) return false; + if (!('description' in value) || value['description'] === undefined) return false; + if (!('required' in value) || value['required'] === undefined) return false; + return true; +} -/** @internal */ -export const PushOptionProperty$inboundSchema: z.ZodType< - PushOptionProperty, - z.ZodTypeDef, - unknown -> = z.object({ - type: PushOptionType$inboundSchema, - displayName: z.string(), - description: z.string(), - required: z.boolean(), - properties: z.nullable( - z.record(z.lazy(() => PushOptionProperty$inboundSchema)), - ).optional(), - options: z.nullable(z.array(PushOptionChoice$inboundSchema)).optional(), - validation: PushValidationInfo$inboundSchema.optional(), -}); +export function PushOptionPropertyFromJSON(json: any): PushOptionProperty { + return PushOptionPropertyFromJSONTyped(json, false); +} + +export function PushOptionPropertyFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionProperty { + if (json == null) { + return json; + } + return { + + 'type': PushOptionTypeFromJSON(json['type']), + 'displayName': json['displayName'], + 'description': json['description'], + 'required': json['required'], + 'properties': json['properties'] == null ? undefined : (mapValues(json['properties'], PushOptionPropertyFromJSON)), + 'options': json['options'] == null ? undefined : ((json['options'] as Array).map(PushOptionChoiceFromJSON)), + 'validation': json['validation'] == null ? undefined : PushValidationInfoFromJSON(json['validation']), + }; +} -export function pushOptionPropertyFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushOptionProperty$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushOptionProperty' from JSON`, - ); +export function PushOptionPropertyToJSON(json: any): PushOptionProperty { + return PushOptionPropertyToJSONTyped(json, false); } + +export function PushOptionPropertyToJSONTyped(value?: PushOptionProperty | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': PushOptionTypeToJSON(value['type']), + 'displayName': value['displayName'], + 'description': value['description'], + 'required': value['required'], + 'properties': value['properties'] == null ? undefined : (mapValues(value['properties'], PushOptionPropertyToJSON)), + 'options': value['options'] == null ? undefined : ((value['options'] as Array).map(PushOptionChoiceToJSON)), + 'validation': PushValidationInfoToJSON(value['validation']), + }; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/pushoptiontype.ts b/sync-for-expenses/src/sdk/models/shared/pushoptiontype.ts index 298c02e2e..cf3e4586c 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushoptiontype.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushoptiontype.ts @@ -1,29 +1,59 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The option type. + * @export */ export const PushOptionType = { - Array: "Array", - Object: "Object", - String: "String", - Number: "Number", - Boolean: "Boolean", - DateTime: "DateTime", - File: "File", - MultiPart: "MultiPart", + Array: 'Array', + Object: 'Object', + String: 'String', + Number: 'Number', + Boolean: 'Boolean', + DateTime: 'DateTime', + File: 'File', + MultiPart: 'MultiPart' } as const; -/** - * The option type. - */ -export type PushOptionType = ClosedEnum; +export type PushOptionType = typeof PushOptionType[keyof typeof PushOptionType]; + + +export function instanceOfPushOptionType(value: any): boolean { + for (const key in PushOptionType) { + if (Object.prototype.hasOwnProperty.call(PushOptionType, key)) { + if (PushOptionType[key as keyof typeof PushOptionType] === value) { + return true; + } + } + } + return false; +} + +export function PushOptionTypeFromJSON(json: any): PushOptionType { + return PushOptionTypeFromJSONTyped(json, false); +} + +export function PushOptionTypeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushOptionType { + return json as PushOptionType; +} + +export function PushOptionTypeToJSON(value?: PushOptionType | null): any { + return value as any; +} + +export function PushOptionTypeToJSONTyped(value: any, ignoreDiscriminator: boolean): PushOptionType { + return value as PushOptionType; +} -/** @internal */ -export const PushOptionType$inboundSchema: z.ZodNativeEnum< - typeof PushOptionType -> = z.nativeEnum(PushOptionType); diff --git a/sync-for-expenses/src/sdk/models/shared/pushvalidationinfo.ts b/sync-for-expenses/src/sdk/models/shared/pushvalidationinfo.ts index 3479adce1..73bdca1cc 100644 --- a/sync-for-expenses/src/sdk/models/shared/pushvalidationinfo.ts +++ b/sync-for-expenses/src/sdk/models/shared/pushvalidationinfo.ts @@ -1,38 +1,164 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { PushFieldValidation } from './pushfieldvalidation'; import { - PushFieldValidation, - PushFieldValidation$inboundSchema, -} from "./pushfieldvalidation.js"; - -export type PushValidationInfo = { - warnings?: Array | null | undefined; - information?: Array | null | undefined; -}; - -/** @internal */ -export const PushValidationInfo$inboundSchema: z.ZodType< - PushValidationInfo, - z.ZodTypeDef, - unknown -> = z.object({ - warnings: z.nullable(z.array(PushFieldValidation$inboundSchema)).optional(), - information: z.nullable(z.array(PushFieldValidation$inboundSchema)) - .optional(), -}); - -export function pushValidationInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => PushValidationInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'PushValidationInfo' from JSON`, - ); + PushFieldValidationFromJSON, + PushFieldValidationFromJSONTyped, + PushFieldValidationToJSON, + PushFieldValidationToJSONTyped, +} from './pushfieldvalidation'; + +/** + * + * @export + * @interface PushValidationInfo + */ +export interface PushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +/** + * Check if a given object implements the PushValidationInfo interface. + */ +export function instanceOfPushValidationInfo(value: object): value is PushValidationInfo { + return true; +} + +export function PushValidationInfoFromJSON(json: any): PushValidationInfo { + return PushValidationInfoFromJSONTyped(json, false); +} + +export function PushValidationInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): PushValidationInfo { + if (json == null) { + return json; + } + return { + + ...json, + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(PushFieldValidationFromJSON)), + 'information': json['information'] == null ? undefined : ((json['information'] as Array).map(PushFieldValidationFromJSON)), + }; +} + +export function PushValidationInfoToJSON(json: any): PushValidationInfo { + return PushValidationInfoToJSONTyped(json, false); +} + +export function PushValidationInfoToJSONTyped(value?: PushValidationInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(PushFieldValidationToJSON)), + 'information': value['information'] == null ? undefined : ((value['information'] as Array).map(PushFieldValidationToJSON)), + }; +} + + +export interface CreateBankAccountsModelGetResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface CreateChartOfAccountsModelGetResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface GetCreateBankAccountsModelResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface GetCreateChartOfAccountsModelResponsePushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; +} + +export interface PushOptionPushValidationInfo { + [key: string]: any | any; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + warnings?: Array | null; + /** + * + * @type {Array} + * @memberof PushValidationInfo + */ + information?: Array | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/recordref.ts b/sync-for-expenses/src/sdk/models/shared/recordref.ts index ef4753cd0..39b899c86 100644 --- a/sync-for-expenses/src/sdk/models/shared/recordref.ts +++ b/sync-for-expenses/src/sdk/models/shared/recordref.ts @@ -1,30 +1,263 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type RecordRef = { - /** - * Identifier of linked reference from mapping options. - */ - id?: string | undefined; -}; - -/** @internal */ -export type RecordRef$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const RecordRef$outboundSchema: z.ZodType< - RecordRef$Outbound, - z.ZodTypeDef, - RecordRef -> = z.object({ - id: z.string().optional(), -}); - -export function recordRefToJSON(recordRef: RecordRef): string { - return JSON.stringify(RecordRef$outboundSchema.parse(recordRef)); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface RecordRef + */ +export interface RecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +/** + * Check if a given object implements the RecordRef interface. + */ +export function instanceOfRecordRef(value: object): value is RecordRef { + return true; +} + +export function RecordRefFromJSON(json: any): RecordRef { + return RecordRefFromJSONTyped(json, false); +} + +export function RecordRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): RecordRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function RecordRefToJSON(json: any): RecordRef { + return RecordRefToJSONTyped(json, false); +} + +export function RecordRefToJSONTyped(value?: RecordRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface AdjustmentTransactionLineRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface AdjustmentTransactionLineRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface AdjustmentTransactionRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface AdjustmentTransactionRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface AdjustmentTransactionRequestRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface AdjustmentTransactionRequestRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface ExpenseTransactionLineRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface ExpenseTransactionLineRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface ExpenseTransactionRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface ExpenseTransactionRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface RecordRefRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface RecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface ReimbursableExpenseTransactionLineRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface ReimbursableExpenseTransactionLineRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdateExpenseRequestRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdateExpenseRequestRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdatingExpenseTransactionRequestRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdatingExpenseTransactionRequestRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestRecordRef { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestRecordReference { + /** + * Identifier of linked reference from mapping options. + * @type {string} + * @memberof RecordRef + */ + id?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransaction.ts b/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransaction.ts index 82f1cbf58..081ea7de1 100644 --- a/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransaction.ts +++ b/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransaction.ts @@ -1,172 +1,384 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { ReimbursementContactRef } from './reimbursementcontactref'; import { - ApAccountRef, - ApAccountRef$Outbound, - ApAccountRef$outboundSchema, -} from "./apaccountref.js"; + ReimbursementContactRefFromJSON, + ReimbursementContactRefFromJSONTyped, + ReimbursementContactRefToJSON, + ReimbursementContactRefToJSONTyped, +} from './reimbursementcontactref'; +import type { ReimbursableExpenseTransactionLine } from './reimbursableexpensetransactionline'; import { - ReimbursableExpenseTransactionLine, - ReimbursableExpenseTransactionLine$Outbound, - ReimbursableExpenseTransactionLine$outboundSchema, -} from "./reimbursableexpensetransactionline.js"; + ReimbursableExpenseTransactionLineFromJSON, + ReimbursableExpenseTransactionLineFromJSONTyped, + ReimbursableExpenseTransactionLineToJSON, + ReimbursableExpenseTransactionLineToJSONTyped, +} from './reimbursableexpensetransactionline'; +import type { ApAccountRef } from './apaccountref'; import { - ReimbursementContactRef, - ReimbursementContactRef$Outbound, - ReimbursementContactRef$outboundSchema, -} from "./reimbursementcontactref.js"; + ApAccountRefFromJSON, + ApAccountRefFromJSONTyped, + ApAccountRefToJSON, + ApAccountRefToJSONTyped, +} from './apaccountref'; -export type ReimbursableExpenseTransaction = { - /** - * Your unique identifier for the transaction. - */ - id: string; - /** - * User-friendly reference for the reimbursable expense. - */ - reference?: string | null | undefined; - contactRef: ReimbursementContactRef; - apAccountRef?: ApAccountRef | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - issueDate: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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; - /** - * Currency the transaction was recorded in. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - /** - * Any private, company notes about the transaction. - */ - notes?: string | undefined; - /** - * Array of transaction lines. - */ - lines?: Array | undefined; -}; +/** + * + * @export + * @interface ReimbursableExpenseTransaction + */ +export interface ReimbursableExpenseTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + id: string; + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof ReimbursableExpenseTransaction + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof ReimbursableExpenseTransaction + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof ReimbursableExpenseTransaction + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof ReimbursableExpenseTransaction + */ + lines?: Array; +} + +/** + * Check if a given object implements the ReimbursableExpenseTransaction interface. + */ +export function instanceOfReimbursableExpenseTransaction(value: object): value is ReimbursableExpenseTransaction { + if (!('id' in value) || value['id'] === undefined) return false; + if (!('contactRef' in value) || value['contactRef'] === undefined) return false; + if (!('issueDate' in value) || value['issueDate'] === undefined) return false; + if (!('dueDate' in value) || value['dueDate'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + return true; +} + +export function ReimbursableExpenseTransactionFromJSON(json: any): ReimbursableExpenseTransaction { + return ReimbursableExpenseTransactionFromJSONTyped(json, false); +} -/** @internal */ -export type ReimbursableExpenseTransaction$Outbound = { - id: string; - reference?: string | null | undefined; - contactRef: ReimbursementContactRef$Outbound; - apAccountRef?: ApAccountRef$Outbound | null | undefined; - issueDate: string; - dueDate: string; - currency: string; - currencyRate?: number | null | undefined; - notes?: string | undefined; - lines?: Array | undefined; -}; +export function ReimbursableExpenseTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReimbursableExpenseTransaction { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + 'reference': json['reference'] == null ? undefined : json['reference'], + 'contactRef': ReimbursementContactRefFromJSON(json['contactRef']), + 'apAccountRef': json['apAccountRef'] == null ? undefined : ApAccountRefFromJSON(json['apAccountRef']), + 'issueDate': json['issueDate'], + 'dueDate': json['dueDate'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'notes': json['notes'] == null ? undefined : json['notes'], + 'lines': json['lines'] == null ? undefined : ((json['lines'] as Array).map(ReimbursableExpenseTransactionLineFromJSON)), + }; +} -/** @internal */ -export const ReimbursableExpenseTransaction$outboundSchema: z.ZodType< - ReimbursableExpenseTransaction$Outbound, - z.ZodTypeDef, - ReimbursableExpenseTransaction -> = z.object({ - id: z.string(), - reference: z.nullable(z.string()).optional(), - contactRef: ReimbursementContactRef$outboundSchema, - apAccountRef: z.nullable(ApAccountRef$outboundSchema).optional(), - issueDate: z.string(), - dueDate: z.string(), - currency: z.string(), - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - notes: z.string().optional(), - lines: z.array(ReimbursableExpenseTransactionLine$outboundSchema).optional(), -}); +export function ReimbursableExpenseTransactionToJSON(json: any): ReimbursableExpenseTransaction { + return ReimbursableExpenseTransactionToJSONTyped(json, false); +} + +export function ReimbursableExpenseTransactionToJSONTyped(value?: ReimbursableExpenseTransaction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'reference': value['reference'], + 'contactRef': ReimbursementContactRefToJSON(value['contactRef']), + 'apAccountRef': ApAccountRefToJSON(value['apAccountRef']), + 'issueDate': value['issueDate'], + 'dueDate': value['dueDate'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'notes': value['notes'], + 'lines': value['lines'] == null ? undefined : ((value['lines'] as Array).map(ReimbursableExpenseTransactionLineToJSON)), + }; +} + + +export interface ReimbursableExpenseTransactionRequest { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + id: string; + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof ReimbursableExpenseTransaction + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof ReimbursableExpenseTransaction + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof ReimbursableExpenseTransaction + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof ReimbursableExpenseTransaction + */ + lines?: Array; +} -export function reimbursableExpenseTransactionToJSON( - reimbursableExpenseTransaction: ReimbursableExpenseTransaction, -): string { - return JSON.stringify( - ReimbursableExpenseTransaction$outboundSchema.parse( - reimbursableExpenseTransaction, - ), - ); +export interface ReimbursableExpenseTransactionRequestReimbursableExpenseTransaction { + /** + * Your unique identifier for the transaction. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + id: string; + /** + * User-friendly reference for the reimbursable expense. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + reference?: string | null; + /** + * + * @type {ReimbursementContactRef} + * @memberof ReimbursableExpenseTransaction + */ + contactRef: ReimbursementContactRef; + /** + * + * @type {ApAccountRef} + * @memberof ReimbursableExpenseTransaction + */ + apAccountRef?: ApAccountRef | null; + /** + * Date of the transaction was recorded. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + issueDate: string; + /** + * Date the supplier is due to be paid. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + dueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof ReimbursableExpenseTransaction + */ + currencyRate?: Decimal | number | null; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof ReimbursableExpenseTransaction + */ + notes?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof ReimbursableExpenseTransaction + */ + lines?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransactionline.ts b/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransactionline.ts index c3acb46f3..d666f08cd 100644 --- a/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransactionline.ts +++ b/sync-for-expenses/src/sdk/models/shared/reimbursableexpensetransactionline.ts @@ -1,91 +1,305 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { RecordRef } from './recordref'; import { - InvoiceTo, - InvoiceTo$Outbound, - InvoiceTo$outboundSchema, -} from "./invoiceto.js"; + RecordRefFromJSON, + RecordRefFromJSONTyped, + RecordRefToJSON, + RecordRefToJSONTyped, +} from './recordref'; +import type { ItemRef } from './itemref'; import { - ItemRef, - ItemRef$Outbound, - ItemRef$outboundSchema, -} from "./itemref.js"; + ItemRefFromJSON, + ItemRefFromJSONTyped, + ItemRefToJSON, + ItemRefToJSONTyped, +} from './itemref'; +import type { TrackingRef } from './trackingref'; import { - RecordRef, - RecordRef$Outbound, - RecordRef$outboundSchema, -} from "./recordref.js"; + TrackingRefFromJSON, + TrackingRefFromJSONTyped, + TrackingRefToJSON, + TrackingRefToJSONTyped, +} from './trackingref'; +import type { InvoiceTo } from './invoiceto'; import { - TrackingRef, - TrackingRef$Outbound, - TrackingRef$outboundSchema, -} from "./trackingref.js"; + InvoiceToFromJSON, + InvoiceToFromJSONTyped, + InvoiceToToJSON, + InvoiceToToJSONTyped, +} from './invoiceto'; -export type ReimbursableExpenseTransactionLine = { - /** - * line description - */ - description?: string | undefined; - /** - * Amount of the line, exclusive of tax. - */ - netAmount: Decimal$ | number; - /** - * Amount of tax for the line. - */ - taxAmount?: Decimal$ | number | undefined; - taxRateRef?: RecordRef | undefined; - accountRef?: RecordRef | undefined; - itemRef?: ItemRef | null | undefined; - trackingRefs?: Array | null | undefined; - /** - * Unique identifier for the customer billed for the transaction. The `invoiceTo` object is currently supported only for QuickBooks Online and QuickBooks Desktop. - */ - invoiceTo?: InvoiceTo | null | undefined; -}; +/** + * + * @export + * @interface ReimbursableExpenseTransactionLine + */ +export interface ReimbursableExpenseTransactionLine { + /** + * line description + * @type {string} + * @memberof ReimbursableExpenseTransactionLine + */ + description?: string; + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ReimbursableExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ReimbursableExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ReimbursableExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} -/** @internal */ -export type ReimbursableExpenseTransactionLine$Outbound = { - description?: string | undefined; - netAmount: number; - taxAmount?: number | undefined; - taxRateRef?: RecordRef$Outbound | undefined; - accountRef?: RecordRef$Outbound | undefined; - itemRef?: ItemRef$Outbound | null | undefined; - trackingRefs?: Array | null | undefined; - invoiceTo?: InvoiceTo$Outbound | null | undefined; -}; +/** + * Check if a given object implements the ReimbursableExpenseTransactionLine interface. + */ +export function instanceOfReimbursableExpenseTransactionLine(value: object): value is ReimbursableExpenseTransactionLine { + if (!('netAmount' in value) || value['netAmount'] === undefined) return false; + return true; +} -/** @internal */ -export const ReimbursableExpenseTransactionLine$outboundSchema: z.ZodType< - ReimbursableExpenseTransactionLine$Outbound, - z.ZodTypeDef, - ReimbursableExpenseTransactionLine -> = z.object({ - description: z.string().optional(), - netAmount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - taxAmount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ).optional(), - taxRateRef: RecordRef$outboundSchema.optional(), - accountRef: RecordRef$outboundSchema.optional(), - itemRef: z.nullable(ItemRef$outboundSchema).optional(), - trackingRefs: z.nullable(z.array(TrackingRef$outboundSchema)).optional(), - invoiceTo: z.nullable(InvoiceTo$outboundSchema).optional(), -}); +export function ReimbursableExpenseTransactionLineFromJSON(json: any): ReimbursableExpenseTransactionLine { + return ReimbursableExpenseTransactionLineFromJSONTyped(json, false); +} + +export function ReimbursableExpenseTransactionLineFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReimbursableExpenseTransactionLine { + if (json == null) { + return json; + } + return { + + 'description': json['description'] == null ? undefined : json['description'], + 'netAmount': json['netAmount'], + 'taxAmount': json['taxAmount'] == null ? undefined : toDecimal(json['taxAmount']), + 'taxRateRef': json['taxRateRef'] == null ? undefined : RecordRefFromJSON(json['taxRateRef']), + 'accountRef': json['accountRef'] == null ? undefined : RecordRefFromJSON(json['accountRef']), + 'itemRef': json['itemRef'] == null ? undefined : ItemRefFromJSON(json['itemRef']), + 'trackingRefs': json['trackingRefs'] == null ? undefined : ((json['trackingRefs'] as Array).map(TrackingRefFromJSON)), + 'invoiceTo': json['invoiceTo'] == null ? undefined : InvoiceToFromJSON(json['invoiceTo']), + }; +} + +export function ReimbursableExpenseTransactionLineToJSON(json: any): ReimbursableExpenseTransactionLine { + return ReimbursableExpenseTransactionLineToJSONTyped(json, false); +} + +export function ReimbursableExpenseTransactionLineToJSONTyped(value?: ReimbursableExpenseTransactionLine | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'netAmount': fromDecimal(value['netAmount']), + 'taxAmount': fromDecimal(value['taxAmount']), + 'taxRateRef': RecordRefToJSON(value['taxRateRef']), + 'accountRef': RecordRefToJSON(value['accountRef']), + 'itemRef': ItemRefToJSON(value['itemRef']), + 'trackingRefs': value['trackingRefs'] == null ? undefined : ((value['trackingRefs'] as Array).map(TrackingRefToJSON)), + 'invoiceTo': InvoiceToToJSON(value['invoiceTo']), + }; +} + + +export interface ReimbursableExpenseTransactionRequestReimbursableExpenseTransactionLine { + /** + * line description + * @type {string} + * @memberof ReimbursableExpenseTransactionLine + */ + description?: string; + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ReimbursableExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ReimbursableExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ReimbursableExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} + +export interface UpdateReimbursableExpenseTransactionRequestReimbursableExpenseTransactionLine { + /** + * line description + * @type {string} + * @memberof ReimbursableExpenseTransactionLine + */ + description?: string; + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ReimbursableExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ReimbursableExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ReimbursableExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; +} -export function reimbursableExpenseTransactionLineToJSON( - reimbursableExpenseTransactionLine: ReimbursableExpenseTransactionLine, -): string { - return JSON.stringify( - ReimbursableExpenseTransactionLine$outboundSchema.parse( - reimbursableExpenseTransactionLine, - ), - ); +export interface UpdatingReimbursableExpenseTransactionRequestReimbursableExpenseTransactionLine { + /** + * line description + * @type {string} + * @memberof ReimbursableExpenseTransactionLine + */ + description?: string; + /** + * Amount of the line, exclusive of tax. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + netAmount: Decimal | number; + /** + * Amount of tax for the line. + * @type {number} + * @memberof ReimbursableExpenseTransactionLine + */ + taxAmount?: Decimal | number; + /** + * + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + taxRateRef?: RecordRef; + /** + * The `accountRef` contains the `id` of the account the transaction is against. The `accountRef` object is required for all integrations except QBD which currently supports either itemRef or accountRef. + * @type {RecordRef} + * @memberof ReimbursableExpenseTransactionLine + */ + accountRef?: RecordRef; + /** + * + * @type {ItemRef} + * @memberof ReimbursableExpenseTransactionLine + */ + itemRef?: ItemRef | null; + /** + * + * @type {Array} + * @memberof ReimbursableExpenseTransactionLine + */ + trackingRefs?: Array | null; + /** + * + * @type {InvoiceTo} + * @memberof ReimbursableExpenseTransactionLine + */ + invoiceTo?: InvoiceTo | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/reimbursementcontactref.ts b/sync-for-expenses/src/sdk/models/shared/reimbursementcontactref.ts index cef4be224..bf6961017 100644 --- a/sync-for-expenses/src/sdk/models/shared/reimbursementcontactref.ts +++ b/sync-for-expenses/src/sdk/models/shared/reimbursementcontactref.ts @@ -1,34 +1,138 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; - -export type ReimbursementContactRef = { - /** - * Identifier of contact. - */ - id: string; -}; - -/** @internal */ -export type ReimbursementContactRef$Outbound = { - id: string; -}; - -/** @internal */ -export const ReimbursementContactRef$outboundSchema: z.ZodType< - ReimbursementContactRef$Outbound, - z.ZodTypeDef, - ReimbursementContactRef -> = z.object({ - id: z.string(), -}); - -export function reimbursementContactRefToJSON( - reimbursementContactRef: ReimbursementContactRef, -): string { - return JSON.stringify( - ReimbursementContactRef$outboundSchema.parse(reimbursementContactRef), - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ReimbursementContactRef + */ +export interface ReimbursementContactRef { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +/** + * Check if a given object implements the ReimbursementContactRef interface. + */ +export function instanceOfReimbursementContactRef(value: object): value is ReimbursementContactRef { + if (!('id' in value) || value['id'] === undefined) return false; + return true; +} + +export function ReimbursementContactRefFromJSON(json: any): ReimbursementContactRef { + return ReimbursementContactRefFromJSONTyped(json, false); +} + +export function ReimbursementContactRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): ReimbursementContactRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'], + }; +} + +export function ReimbursementContactRefToJSON(json: any): ReimbursementContactRef { + return ReimbursementContactRefToJSONTyped(json, false); +} + +export function ReimbursementContactRefToJSONTyped(value?: ReimbursementContactRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface ContactReference { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface ReimbursableExpenseTransactionRequestContactReference { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface ReimbursableExpenseTransactionRequestReimbursementContactRef { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface ReimbursementContactRefContactReference { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestContactReference { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface UpdateReimbursableExpenseTransactionRequestReimbursementContactRef { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestContactReference { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; +} + +export interface UpdatingReimbursableExpenseTransactionRequestReimbursementContactRef { + /** + * Identifier of contact. + * @type {string} + * @memberof ReimbursementContactRef + */ + id: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/security.ts b/sync-for-expenses/src/sdk/models/shared/security.ts deleted file mode 100644 index 675eaa582..000000000 --- a/sync-for-expenses/src/sdk/models/shared/security.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; - -export type Security = { - authHeader: string; -}; - -/** @internal */ -export type Security$Outbound = { - auth_header: string; -}; - -/** @internal */ -export const Security$outboundSchema: z.ZodType< - Security$Outbound, - z.ZodTypeDef, - Security -> = z.object({ - authHeader: z.string(), -}).transform((v) => { - return remap$(v, { - authHeader: "auth_header", - }); -}); - -export function securityToJSON(security: Security): string { - return JSON.stringify(Security$outboundSchema.parse(security)); -} diff --git a/sync-for-expenses/src/sdk/models/shared/status.ts b/sync-for-expenses/src/sdk/models/shared/status.ts index 7b458b0a8..2f86fa03d 100644 --- a/sync-for-expenses/src/sdk/models/shared/status.ts +++ b/sync-for-expenses/src/sdk/models/shared/status.ts @@ -1,41 +1,72 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * The current status of the dataset. + * @export */ export const Status = { - Initial: "Initial", - Queued: "Queued", - Fetching: "Fetching", - MapQueued: "MapQueued", - Mapping: "Mapping", - Complete: "Complete", - FetchError: "FetchError", - MapError: "MapError", - InternalError: "InternalError", - ProcessingQueued: "ProcessingQueued", - Processing: "Processing", - ProcessingError: "ProcessingError", - ValidationQueued: "ValidationQueued", - Validating: "Validating", - ValidationError: "ValidationError", - AuthError: "AuthError", - Cancelled: "Cancelled", - NotSupported: "NotSupported", - RateLimitError: "RateLimitError", - PermissionsError: "PermissionsError", - PrerequisiteNotMet: "PrerequisiteNotMet", + Initial: 'Initial', + Queued: 'Queued', + Fetching: 'Fetching', + MapQueued: 'MapQueued', + Mapping: 'Mapping', + Complete: 'Complete', + FetchError: 'FetchError', + MapError: 'MapError', + InternalError: 'InternalError', + ProcessingQueued: 'ProcessingQueued', + Processing: 'Processing', + ProcessingError: 'ProcessingError', + ValidationQueued: 'ValidationQueued', + Validating: 'Validating', + ValidationError: 'ValidationError', + AuthError: 'AuthError', + Cancelled: 'Cancelled', + NotSupported: 'NotSupported', + RateLimitError: 'RateLimitError', + PermissionsError: 'PermissionsError', + PrerequisiteNotMet: 'PrerequisiteNotMet' } as const; -/** - * The current status of the dataset. - */ -export type Status = ClosedEnum; +export type Status = typeof Status[keyof typeof Status]; + + +export function instanceOfStatus(value: any): boolean { + for (const key in Status) { + if (Object.prototype.hasOwnProperty.call(Status, key)) { + if (Status[key as keyof typeof Status] === value) { + return true; + } + } + } + return false; +} + +export function StatusFromJSON(json: any): Status { + return StatusFromJSONTyped(json, false); +} + +export function StatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): Status { + return json as Status; +} + +export function StatusToJSON(value?: Status | null): any { + return value as any; +} + +export function StatusToJSONTyped(value: any, ignoreDiscriminator: boolean): Status { + return value as Status; +} -/** @internal */ -export const Status$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(Status); diff --git a/sync-for-expenses/src/sdk/models/shared/supplementaldata.ts b/sync-for-expenses/src/sdk/models/shared/supplementaldata.ts index bdea4887c..c19901524 100644 --- a/sync-for-expenses/src/sdk/models/shared/supplementaldata.ts +++ b/sync-for-expenses/src/sdk/models/shared/supplementaldata.ts @@ -1,58 +1,337 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - +/* tslint:disable */ +/* eslint-disable */ /** - * Supplemental data is additional data you can include in our standard data types. + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | * - * @remarks + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * 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. + * @export + * @interface SupplementalData + */ +export interface SupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +/** + * Check if a given object implements the SupplementalData interface. */ -export type SupplementalData = { - content?: { [k: string]: { [k: string]: any } } | null | undefined; -}; - -/** @internal */ -export const SupplementalData$inboundSchema: z.ZodType< - SupplementalData, - z.ZodTypeDef, - unknown -> = z.object({ - content: z.nullable(z.record(z.record(z.any()))).optional(), -}); -/** @internal */ -export type SupplementalData$Outbound = { - content?: { [k: string]: { [k: string]: any } } | null | undefined; -}; - -/** @internal */ -export const SupplementalData$outboundSchema: z.ZodType< - SupplementalData$Outbound, - z.ZodTypeDef, - SupplementalData -> = z.object({ - content: z.nullable(z.record(z.record(z.any()))).optional(), -}); - -export function supplementalDataToJSON( - supplementalData: SupplementalData, -): string { - return JSON.stringify( - SupplementalData$outboundSchema.parse(supplementalData), - ); -} -export function supplementalDataFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SupplementalData$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupplementalData' from JSON`, - ); +export function instanceOfSupplementalData(value: object): value is SupplementalData { + return true; +} + +export function SupplementalDataFromJSON(json: any): SupplementalData { + return SupplementalDataFromJSONTyped(json, false); +} + +export function SupplementalDataFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplementalData { + if (json == null) { + return json; + } + return { + + 'content': json['content'] == null ? undefined : json['content'], + }; +} + +export function SupplementalDataToJSON(json: any): SupplementalData { + return SupplementalDataToJSONTyped(json, false); +} + +export function SupplementalDataToJSONTyped(value?: SupplementalData | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'content': value['content'], + }; +} + + +export interface AccountCreateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface AccountSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface AccountingAccountSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface AccountingBankAccountSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface AccountingCompanyInformationSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface AccountingCustomerSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface AccountingSupplierSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface BankAccountCreateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface BankAccountSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CompanyInfoGetResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CompanyInformationSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CreateAccountResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CreateBankAccountResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CreateCustomerResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CreateSupplierResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CustomerCreateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CustomerGetResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CustomerSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CustomerUpdateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface CustomersSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface GetCompanyInfoResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface GetCustomerResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface GetSupplierResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface SupplierCreateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface SupplierGetResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface SupplierSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface SupplierUpdateResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface SuppliersSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface UpdateCustomerResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; +} + +export interface UpdateSupplierResponseSupplementalData { + /** + * + * @type {{ [key: string]: { [key: string]: any; }; }} + * @memberof SupplementalData + */ + content?: { [key: string]: { [key: string]: any; }; } | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/supplier.ts b/sync-for-expenses/src/sdk/models/shared/supplier.ts index 9b5b3bdbb..6bcf425e5 100644 --- a/sync-for-expenses/src/sdk/models/shared/supplier.ts +++ b/sync-for-expenses/src/sdk/models/shared/supplier.ts @@ -1,166 +1,2843 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { SupplierStatus } from './supplierstatus'; import { - Items, - Items$inboundSchema, - Items$Outbound, - Items$outboundSchema, -} from "./items.js"; + SupplierStatusFromJSON, + SupplierStatusFromJSONTyped, + SupplierStatusToJSON, + SupplierStatusToJSONTyped, +} from './supplierstatus'; +import type { SupplementalData } from './supplementaldata'; import { - Metadata, - Metadata$inboundSchema, - Metadata$Outbound, - Metadata$outboundSchema, -} from "./metadata.js"; + SupplementalDataFromJSON, + SupplementalDataFromJSONTyped, + SupplementalDataToJSON, + SupplementalDataToJSONTyped, +} from './supplementaldata'; +import type { Metadata } from './metadata'; import { - SupplementalData, - SupplementalData$inboundSchema, - SupplementalData$Outbound, - SupplementalData$outboundSchema, -} from "./supplementaldata.js"; + MetadataFromJSON, + MetadataFromJSONTyped, + MetadataToJSON, + MetadataToJSONTyped, +} from './metadata'; +import type { Items } from './items'; import { - SupplierStatus, - SupplierStatus$inboundSchema, - SupplierStatus$outboundSchema, -} from "./supplierstatus.js"; + ItemsFromJSON, + ItemsFromJSONTyped, + ItemsToJSON, + ItemsToJSONTyped, +} from './items'; /** * ## Overview - * - * @remarks - * + * * From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). + * @export + * @interface Supplier */ -export type Supplier = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the supplier, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the supplier as recorded in the accounting system, typically the company name. - */ - supplierName?: string | null | undefined; - /** - * Name of the main contact for the supplier. - */ - contactName?: string | null | undefined; - /** - * Email address that the supplier may be contacted on. - */ - emailAddress?: string | null | undefined; - /** - * Phone number that the supplier may be contacted on. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. - */ - registrationNumber?: string | null | undefined; - /** - * Supplier's company tax number. - */ - taxNumber?: string | null | undefined; - /** - * Status of the supplier. - */ - status: SupplierStatus; - /** - * Default currency the supplier's transactional data is recorded in. - */ - defaultCurrency?: string | null | undefined; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; - -/** @internal */ -export const Supplier$inboundSchema: z.ZodType< - Supplier, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - supplierName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$inboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: SupplierStatus$inboundSchema, - defaultCurrency: z.nullable(z.string()).optional(), - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); -/** @internal */ -export type Supplier$Outbound = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - id?: string | undefined; - supplierName?: string | null | undefined; - contactName?: string | null | undefined; - emailAddress?: string | null | undefined; - phone?: string | null | undefined; - addresses?: Array | null | undefined; - registrationNumber?: string | null | undefined; - taxNumber?: string | null | undefined; - status: string; - defaultCurrency?: string | null | undefined; - metadata?: Metadata$Outbound | undefined; - supplementalData?: SupplementalData$Outbound | undefined; -}; - -/** @internal */ -export const Supplier$outboundSchema: z.ZodType< - Supplier$Outbound, - z.ZodTypeDef, - Supplier -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - supplierName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$outboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: SupplierStatus$outboundSchema, - defaultCurrency: z.nullable(z.string()).optional(), - metadata: Metadata$outboundSchema.optional(), - supplementalData: SupplementalData$outboundSchema.optional(), -}); - -export function supplierToJSON(supplier: Supplier): string { - return JSON.stringify(Supplier$outboundSchema.parse(supplier)); -} -export function supplierFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Supplier$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Supplier' from JSON`, - ); +export interface Supplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + + + +/** + * Check if a given object implements the Supplier interface. + */ +export function instanceOfSupplier(value: object): value is Supplier { + if (!('status' in value) || value['status'] === undefined) return false; + return true; +} + +export function SupplierFromJSON(json: any): Supplier { + return SupplierFromJSONTyped(json, false); +} + +export function SupplierFromJSONTyped(json: any, ignoreDiscriminator: boolean): Supplier { + if (json == null) { + return json; + } + return { + + 'modifiedDate': json['modifiedDate'] == null ? undefined : json['modifiedDate'], + 'sourceModifiedDate': json['sourceModifiedDate'] == null ? undefined : json['sourceModifiedDate'], + 'id': json['id'] == null ? undefined : json['id'], + 'supplierName': json['supplierName'] == null ? undefined : json['supplierName'], + 'contactName': json['contactName'] == null ? undefined : json['contactName'], + 'emailAddress': json['emailAddress'] == null ? undefined : json['emailAddress'], + 'phone': json['phone'] == null ? undefined : json['phone'], + 'addresses': json['addresses'] == null ? undefined : ((json['addresses'] as Array).map(ItemsFromJSON)), + 'registrationNumber': json['registrationNumber'] == null ? undefined : json['registrationNumber'], + 'taxNumber': json['taxNumber'] == null ? undefined : json['taxNumber'], + 'status': SupplierStatusFromJSON(json['status']), + 'defaultCurrency': json['defaultCurrency'] == null ? undefined : json['defaultCurrency'], + 'metadata': json['metadata'] == null ? undefined : MetadataFromJSON(json['metadata']), + 'supplementalData': json['supplementalData'] == null ? undefined : SupplementalDataFromJSON(json['supplementalData']), + }; +} + +export function SupplierToJSON(json: any): Supplier { + return SupplierToJSONTyped(json, false); +} + +export function SupplierToJSONTyped(value?: Supplier | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'modifiedDate': value['modifiedDate'], + 'sourceModifiedDate': value['sourceModifiedDate'], + 'id': value['id'], + 'supplierName': value['supplierName'], + 'contactName': value['contactName'], + 'emailAddress': value['emailAddress'], + 'phone': value['phone'], + 'addresses': value['addresses'] == null ? undefined : ((value['addresses'] as Array).map(ItemsToJSON)), + 'registrationNumber': value['registrationNumber'], + 'taxNumber': value['taxNumber'], + 'status': SupplierStatusToJSON(value['status']), + 'defaultCurrency': value['defaultCurrency'], + 'metadata': MetadataToJSON(value['metadata']), + 'supplementalData': SupplementalDataToJSON(value['supplementalData']), + }; +} + + +export interface AccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface CreateSupplierRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface CreateSupplierResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface CreateSupplierResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface CreateSupplierSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface GetSupplierResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface GetSupplierResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface ListSuppliersResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface ListSuppliersResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierCreateRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierCreateResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierCreateResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierGetResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierGetResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierUpdateRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierUpdateResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SupplierUpdateResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SuppliersAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SuppliersListResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SuppliersListResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface SuppliersSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface UpdateSupplierRequestBody { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface UpdateSupplierResponseAccountingSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface UpdateSupplierResponseSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; +} + +export interface UpdateSupplierSupplier { + /** + * The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache. + * + * Use it to identify and retrieve records that have changed since your last fetch. For example, filtering `modifiedDate` to today will provide new records updated in Codat today. + * + * This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports ([read more](https://docs.codat.io/using-the-api/modified-dates#modified-date)). + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + modifiedDate?: string; + /** + * The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice. + * + * It is not populated ([read more](https://docs.codat.io/using-the-api/modified-dates#source-modified-date)) when: + * - Pulling attachments + * - The accounting software does not provide modification dates for a data type + * - A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred + * - A record has been voided. For certain platforms that soft delete records, `isDeleted` metadata is used to identify void records + * + * In Codat's data model, dates and times are represented using the ISO 8601 standard. + * @type {string} + * @memberof Supplier + */ + sourceModifiedDate?: string; + /** + * Identifier for the supplier, unique to the company in the accounting software. + * @type {string} + * @memberof Supplier + */ + id?: string; + /** + * Name of the supplier as recorded in the accounting system, typically the company name. + * @type {string} + * @memberof Supplier + */ + supplierName?: string | null; + /** + * Name of the main contact for the supplier. + * @type {string} + * @memberof Supplier + */ + contactName?: string | null; + /** + * Email address that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + emailAddress?: string | null; + /** + * Phone number that the supplier may be contacted on. + * @type {string} + * @memberof Supplier + */ + phone?: string | null; + /** + * An array of Addresses. + * @type {Array} + * @memberof Supplier + */ + addresses?: Array | null; + /** + * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. + * @type {string} + * @memberof Supplier + */ + registrationNumber?: string | null; + /** + * Supplier's company tax number. + * @type {string} + * @memberof Supplier + */ + taxNumber?: string | null; + /** + * + * @type {SupplierStatus} + * @memberof Supplier + */ + status: SupplierStatus; + /** + * Default currency the supplier's transactional data is recorded in. + * @type {string} + * @memberof Supplier + */ + defaultCurrency?: string | null; + /** + * + * @type {Metadata} + * @memberof Supplier + */ + metadata?: Metadata; + /** + * + * @type {SupplementalData} + * @memberof Supplier + */ + supplementalData?: SupplementalData; } diff --git a/sync-for-expenses/src/sdk/models/shared/supplierdetails.ts b/sync-for-expenses/src/sdk/models/shared/supplierdetails.ts index c6b2329d6..c0440349e 100644 --- a/sync-for-expenses/src/sdk/models/shared/supplierdetails.ts +++ b/sync-for-expenses/src/sdk/models/shared/supplierdetails.ts @@ -1,52 +1,110 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type SupplierDetails = { - /** - * Identifier for the supplier, unique to the company in the accounting software. - */ - id?: string | undefined; -}; - -/** @internal */ -export const SupplierDetails$inboundSchema: z.ZodType< - SupplierDetails, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), -}); -/** @internal */ -export type SupplierDetails$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const SupplierDetails$outboundSchema: z.ZodType< - SupplierDetails$Outbound, - z.ZodTypeDef, - SupplierDetails -> = z.object({ - id: z.string().optional(), -}); - -export function supplierDetailsToJSON( - supplierDetails: SupplierDetails, -): string { - return JSON.stringify(SupplierDetails$outboundSchema.parse(supplierDetails)); -} -export function supplierDetailsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => SupplierDetails$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'SupplierDetails' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface SupplierDetails + */ +export interface SupplierDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof SupplierDetails + */ + id?: string; +} + +/** + * Check if a given object implements the SupplierDetails interface. + */ +export function instanceOfSupplierDetails(value: object): value is SupplierDetails { + return true; +} + +export function SupplierDetailsFromJSON(json: any): SupplierDetails { + return SupplierDetailsFromJSONTyped(json, false); +} + +export function SupplierDetailsFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplierDetails { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + }; +} + +export function SupplierDetailsToJSON(json: any): SupplierDetails { + return SupplierDetailsToJSONTyped(json, false); +} + +export function SupplierDetailsToJSONTyped(value?: SupplierDetails | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + }; +} + + +export interface CompanyConfigurationGetResponseSupplierDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof SupplierDetails + */ + id?: string; +} + +export interface CompanyConfigurationSetResponseSupplierDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof SupplierDetails + */ + id?: string; +} + +export interface CompanyConfigurationSupplierDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof SupplierDetails + */ + id?: string; +} + +export interface GetCompanyConfigurationResponseSupplierDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof SupplierDetails + */ + id?: string; +} + +export interface SetCompanyConfigurationResponseSupplierDetails { + /** + * Identifier for the customer, unique to the company in the accounting software. + * @type {string} + * @memberof SupplierDetails + */ + id?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/suppliers.ts b/sync-for-expenses/src/sdk/models/shared/suppliers.ts index 46de174dc..e9e8ae7fe 100644 --- a/sync-for-expenses/src/sdk/models/shared/suppliers.ts +++ b/sync-for-expenses/src/sdk/models/shared/suppliers.ts @@ -1,55 +1,182 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { Supplier, Supplier$inboundSchema } from "./supplier.js"; - -export type Suppliers = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Suppliers$inboundSchema: z.ZodType< - Suppliers, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(z.nullable(Supplier$inboundSchema)).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function suppliersFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Suppliers$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Suppliers' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; +import type { Supplier } from './supplier'; +import { + SupplierFromJSON, + SupplierFromJSONTyped, + SupplierToJSON, + SupplierToJSONTyped, +} from './supplier'; + +/** + * + * @export + * @interface Suppliers + */ +export interface Suppliers { + /** + * Current page number. + * @type {number} + * @memberof Suppliers + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Suppliers + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Suppliers + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Suppliers + */ + links: Links; + /** + * + * @type {Array} + * @memberof Suppliers + */ + results?: Array; +} + +/** + * Check if a given object implements the Suppliers interface. + */ +export function instanceOfSuppliers(value: object): value is Suppliers { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function SuppliersFromJSON(json: any): Suppliers { + return SuppliersFromJSONTyped(json, false); +} + +export function SuppliersFromJSONTyped(json: any, ignoreDiscriminator: boolean): Suppliers { + if (json == null) { + return json; + } + return { + + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(SupplierFromJSON)), + }; +} + +export function SuppliersToJSON(json: any): Suppliers { + return SuppliersToJSONTyped(json, false); +} + +export function SuppliersToJSONTyped(value?: Suppliers | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(SupplierToJSON)), + }; +} + + +export interface ListSuppliersResponseSuppliers { + /** + * Current page number. + * @type {number} + * @memberof Suppliers + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Suppliers + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Suppliers + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Suppliers + */ + links: Links; + /** + * + * @type {Array} + * @memberof Suppliers + */ + results?: Array; +} + +export interface SuppliersListResponseSuppliers { + /** + * Current page number. + * @type {number} + * @memberof Suppliers + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Suppliers + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Suppliers + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Suppliers + */ + links: Links; + /** + * + * @type {Array} + * @memberof Suppliers + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/supplierstatus.ts b/sync-for-expenses/src/sdk/models/shared/supplierstatus.ts index 21b6220e1..88e52372c 100644 --- a/sync-for-expenses/src/sdk/models/shared/supplierstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/supplierstatus.ts @@ -1,28 +1,54 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of the supplier. + * @export */ export const SupplierStatus = { - Unknown: "Unknown", - Active: "Active", - Archived: "Archived", + Unknown: 'Unknown', + Active: 'Active', + Archived: 'Archived' } as const; -/** - * Status of the supplier. - */ -export type SupplierStatus = ClosedEnum; - -/** @internal */ -export const SupplierStatus$inboundSchema: z.ZodNativeEnum< - typeof SupplierStatus -> = z.nativeEnum(SupplierStatus); -/** @internal */ -export const SupplierStatus$outboundSchema: z.ZodNativeEnum< - typeof SupplierStatus -> = SupplierStatus$inboundSchema; +export type SupplierStatus = typeof SupplierStatus[keyof typeof SupplierStatus]; + + +export function instanceOfSupplierStatus(value: any): boolean { + for (const key in SupplierStatus) { + if (Object.prototype.hasOwnProperty.call(SupplierStatus, key)) { + if (SupplierStatus[key as keyof typeof SupplierStatus] === value) { + return true; + } + } + } + return false; +} + +export function SupplierStatusFromJSON(json: any): SupplierStatus { + return SupplierStatusFromJSONTyped(json, false); +} + +export function SupplierStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): SupplierStatus { + return json as SupplierStatus; +} + +export function SupplierStatusToJSON(value?: SupplierStatus | null): any { + return value as any; +} + +export function SupplierStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): SupplierStatus { + return value as SupplierStatus; +} + diff --git a/sync-for-expenses/src/sdk/models/shared/taxratemappinginfo.ts b/sync-for-expenses/src/sdk/models/shared/taxratemappinginfo.ts index 9cb982b91..ab3257a22 100644 --- a/sync-for-expenses/src/sdk/models/shared/taxratemappinginfo.ts +++ b/sync-for-expenses/src/sdk/models/shared/taxratemappinginfo.ts @@ -1,65 +1,243 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { - ValidTransactionTypes, - ValidTransactionTypes$inboundSchema, -} from "./validtransactiontypes.js"; +import type { ValidTransactionTypes } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +/** + * + * @export + * @interface TaxRateMappingInfo + */ +export interface TaxRateMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of tax rate. + * @type {string} + * @memberof TaxRateMappingInfo + */ + id?: string; + /** + * Name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + name?: string; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + code?: string | null; + /** + * Effective tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + effectiveTaxRate?: Decimal | number; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + totalTaxRate?: Decimal | number; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof TaxRateMappingInfo + */ + validTransactionTypes?: Array; +} + + +/** + * @export + */ +export const TaxRateMappingInfoValidTransactionTypesEnum = { + Payment: 'Payment', + Refund: 'Refund', + Reward: 'Reward', + Chargeback: 'Chargeback' +} as const; +export type TaxRateMappingInfoValidTransactionTypesEnum = typeof TaxRateMappingInfoValidTransactionTypesEnum[keyof typeof TaxRateMappingInfoValidTransactionTypesEnum]; -export type TaxRateMappingInfo = { - /** - * Unique identifier of tax rate. - */ - id?: string | undefined; - /** - * Name of the tax rate in the accounting software. - */ - name?: string | undefined; - /** - * Code for the tax rate from the accounting software. - */ - code?: string | null | undefined; - /** - * Effective tax rate. - */ - effectiveTaxRate?: Decimal$ | number | undefined; - /** - * Total (not compounded) sum of the components of a tax rate. - */ - totalTaxRate?: Decimal$ | number | undefined; - /** - * Supported transaction types for the account. - */ - validTransactionTypes?: Array | undefined; -}; -/** @internal */ -export const TaxRateMappingInfo$inboundSchema: z.ZodType< - TaxRateMappingInfo, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - code: z.nullable(z.string()).optional(), - effectiveTaxRate: z.number().transform(v => new Decimal$(v)).optional(), - totalTaxRate: z.number().transform(v => new Decimal$(v)).optional(), - validTransactionTypes: z.array(ValidTransactionTypes$inboundSchema) - .optional(), -}); +/** + * Check if a given object implements the TaxRateMappingInfo interface. + */ +export function instanceOfTaxRateMappingInfo(value: object): value is TaxRateMappingInfo { + return true; +} + +export function TaxRateMappingInfoFromJSON(json: any): TaxRateMappingInfo { + return TaxRateMappingInfoFromJSONTyped(json, false); +} + +export function TaxRateMappingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): TaxRateMappingInfo { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'code': json['code'] == null ? undefined : json['code'], + 'effectiveTaxRate': json['effectiveTaxRate'] == null ? undefined : toDecimal(json['effectiveTaxRate']), + 'totalTaxRate': json['totalTaxRate'] == null ? undefined : toDecimal(json['totalTaxRate']), + 'validTransactionTypes': json['validTransactionTypes'] == null ? undefined : json['validTransactionTypes'], + }; +} + +export function TaxRateMappingInfoToJSON(json: any): TaxRateMappingInfo { + return TaxRateMappingInfoToJSONTyped(json, false); +} + +export function TaxRateMappingInfoToJSONTyped(value?: TaxRateMappingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'name': value['name'], + 'code': value['code'], + 'effectiveTaxRate': fromDecimal(value['effectiveTaxRate']), + 'totalTaxRate': fromDecimal(value['totalTaxRate']), + 'validTransactionTypes': value['validTransactionTypes'], + }; +} + + +export interface GetMappingOptionsResponseTaxRateMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of tax rate. + * @type {string} + * @memberof TaxRateMappingInfo + */ + id?: string; + /** + * Name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + name?: string; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + code?: string | null; + /** + * Effective tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + effectiveTaxRate?: Decimal | number; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + totalTaxRate?: Decimal | number; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof TaxRateMappingInfo + */ + validTransactionTypes?: Array; +} + +export interface MappingOptionsGetResponseTaxRateMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of tax rate. + * @type {string} + * @memberof TaxRateMappingInfo + */ + id?: string; + /** + * Name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + name?: string; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + code?: string | null; + /** + * Effective tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + effectiveTaxRate?: Decimal | number; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + totalTaxRate?: Decimal | number; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof TaxRateMappingInfo + */ + validTransactionTypes?: Array; +} -export function taxRateMappingInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TaxRateMappingInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TaxRateMappingInfo' from JSON`, - ); +export interface MappingOptionsTaxRateMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of tax rate. + * @type {string} + * @memberof TaxRateMappingInfo + */ + id?: string; + /** + * Name of the tax rate in the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + name?: string; + /** + * Code for the tax rate from the accounting software. + * @type {string} + * @memberof TaxRateMappingInfo + */ + code?: string | null; + /** + * Effective tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + effectiveTaxRate?: Decimal | number; + /** + * Total (not compounded) sum of the components of a tax rate. + * @type {number} + * @memberof TaxRateMappingInfo + */ + totalTaxRate?: Decimal | number; + /** + * Supported transaction types for the account. + * @type {Array} + * @memberof TaxRateMappingInfo + */ + validTransactionTypes?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/trackingcategorymappinginfo.ts b/sync-for-expenses/src/sdk/models/shared/trackingcategorymappinginfo.ts index 112aac93d..7088cf2c8 100644 --- a/sync-for-expenses/src/sdk/models/shared/trackingcategorymappinginfo.ts +++ b/sync-for-expenses/src/sdk/models/shared/trackingcategorymappinginfo.ts @@ -1,49 +1,176 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type TrackingCategoryMappingInfo = { - /** - * Unique identifier of the tracking category. - */ - id?: string | undefined; - /** - * Name of the tracking category as it appears in the accounting software. - */ - name?: string | undefined; - /** - * Boolean of whether the tracking category has child categories. - */ - hasChildren?: boolean | undefined; - /** - * ID of the parent tracking category - */ - parentId?: string | null | undefined; -}; - -/** @internal */ -export const TrackingCategoryMappingInfo$inboundSchema: z.ZodType< - TrackingCategoryMappingInfo, - z.ZodTypeDef, - unknown -> = z.object({ - id: z.string().optional(), - name: z.string().optional(), - hasChildren: z.boolean().optional(), - parentId: z.nullable(z.string()).optional(), -}); - -export function trackingCategoryMappingInfoFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TrackingCategoryMappingInfo$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TrackingCategoryMappingInfo' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface TrackingCategoryMappingInfo + */ +export interface TrackingCategoryMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of the tracking category. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + id?: string; + /** + * Name of the tracking category as it appears in the accounting software. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + name?: string; + /** + * Boolean of whether the tracking category has child categories. + * @type {boolean} + * @memberof TrackingCategoryMappingInfo + */ + hasChildren?: boolean; + /** + * ID of the parent tracking category + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + parentId?: string | null; +} + +/** + * Check if a given object implements the TrackingCategoryMappingInfo interface. + */ +export function instanceOfTrackingCategoryMappingInfo(value: object): value is TrackingCategoryMappingInfo { + return true; +} + +export function TrackingCategoryMappingInfoFromJSON(json: any): TrackingCategoryMappingInfo { + return TrackingCategoryMappingInfoFromJSONTyped(json, false); +} + +export function TrackingCategoryMappingInfoFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrackingCategoryMappingInfo { + if (json == null) { + return json; + } + return { + + ...json, + 'id': json['id'] == null ? undefined : json['id'], + 'name': json['name'] == null ? undefined : json['name'], + 'hasChildren': json['hasChildren'] == null ? undefined : json['hasChildren'], + 'parentId': json['parentId'] == null ? undefined : json['parentId'], + }; +} + +export function TrackingCategoryMappingInfoToJSON(json: any): TrackingCategoryMappingInfo { + return TrackingCategoryMappingInfoToJSONTyped(json, false); +} + +export function TrackingCategoryMappingInfoToJSONTyped(value?: TrackingCategoryMappingInfo | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'id': value['id'], + 'name': value['name'], + 'hasChildren': value['hasChildren'], + 'parentId': value['parentId'], + }; +} + + +export interface GetMappingOptionsResponseTrackingCategoryMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of the tracking category. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + id?: string; + /** + * Name of the tracking category as it appears in the accounting software. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + name?: string; + /** + * Boolean of whether the tracking category has child categories. + * @type {boolean} + * @memberof TrackingCategoryMappingInfo + */ + hasChildren?: boolean; + /** + * ID of the parent tracking category + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + parentId?: string | null; +} + +export interface MappingOptionsGetResponseTrackingCategoryMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of the tracking category. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + id?: string; + /** + * Name of the tracking category as it appears in the accounting software. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + name?: string; + /** + * Boolean of whether the tracking category has child categories. + * @type {boolean} + * @memberof TrackingCategoryMappingInfo + */ + hasChildren?: boolean; + /** + * ID of the parent tracking category + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + parentId?: string | null; +} + +export interface MappingOptionsTrackingCategoryMappingInfo { + [key: string]: any | any; + /** + * Unique identifier of the tracking category. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + id?: string; + /** + * Name of the tracking category as it appears in the accounting software. + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + name?: string; + /** + * Boolean of whether the tracking category has child categories. + * @type {boolean} + * @memberof TrackingCategoryMappingInfo + */ + hasChildren?: boolean; + /** + * ID of the parent tracking category + * @type {string} + * @memberof TrackingCategoryMappingInfo + */ + parentId?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/trackingref.ts b/sync-for-expenses/src/sdk/models/shared/trackingref.ts index 11809c369..849041749 100644 --- a/sync-for-expenses/src/sdk/models/shared/trackingref.ts +++ b/sync-for-expenses/src/sdk/models/shared/trackingref.ts @@ -1,54 +1,206 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; +import type { TrackingRefDataType } from '../_speakeasy_enums'; +import type { Customers } from './customers'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface TrackingRef + */ +export interface TrackingRef { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + /** - * The type of the linked reference + * @export */ -export const TrackingRefDataType = { - TrackingCategories: "trackingCategories", - Customers: "customers", +export const TrackingRefDataTypeEnum = { + TrackingCategories: 'trackingCategories', + Customers: 'customers' } as const; +export type TrackingRefDataTypeEnum = typeof TrackingRefDataTypeEnum[keyof typeof TrackingRefDataTypeEnum]; + + /** - * The type of the linked reference + * Check if a given object implements the TrackingRef interface. */ -export type TrackingRefDataType = ClosedEnum; - -export type TrackingRef = { - /** - * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. - */ - id?: string | undefined; - /** - * The type of the linked reference - */ - dataType?: TrackingRefDataType | undefined; -}; - -/** @internal */ -export const TrackingRefDataType$outboundSchema: z.ZodNativeEnum< - typeof TrackingRefDataType -> = z.nativeEnum(TrackingRefDataType); - -/** @internal */ -export type TrackingRef$Outbound = { - id?: string | undefined; - dataType: string; -}; - -/** @internal */ -export const TrackingRef$outboundSchema: z.ZodType< - TrackingRef$Outbound, - z.ZodTypeDef, - TrackingRef -> = z.object({ - id: z.string().optional(), - dataType: TrackingRefDataType$outboundSchema.default("trackingCategories"), -}); - -export function trackingRefToJSON(trackingRef: TrackingRef): string { - return JSON.stringify(TrackingRef$outboundSchema.parse(trackingRef)); +export function instanceOfTrackingRef(value: object): value is TrackingRef { + return true; +} + +export function TrackingRefFromJSON(json: any): TrackingRef { + return TrackingRefFromJSONTyped(json, false); +} + +export function TrackingRefFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrackingRef { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + }; +} + +export function TrackingRefToJSON(json: any): TrackingRef { + return TrackingRefToJSONTyped(json, false); +} + +export function TrackingRefToJSONTyped(value?: TrackingRef | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'dataType': value['dataType'], + }; +} + + +export interface AdjustmentTransactionLineTrackingReference { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface ExpenseTransactionLineTrackingRef { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface ExpenseTransactionLineTrackingReference { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface ReimbursableExpenseTransactionLineTrackingRef { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface ReimbursableExpenseTransactionLineTrackingReference { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface TrackingRefAdjustmentTransactionTrackingReference { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface TrackingRefTrackingReference { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; +} + +export interface TrackingReference { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer. + * @type {string} + * @memberof TrackingRef + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRef + */ + dataType?: TrackingRefDataType; } diff --git a/sync-for-expenses/src/sdk/models/shared/trackingrefadjustmenttransaction.ts b/sync-for-expenses/src/sdk/models/shared/trackingrefadjustmenttransaction.ts index 661d5e5fb..df1138652 100644 --- a/sync-for-expenses/src/sdk/models/shared/trackingrefadjustmenttransaction.ts +++ b/sync-for-expenses/src/sdk/models/shared/trackingrefadjustmenttransaction.ts @@ -1,65 +1,103 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; +import type { TrackingRefAdjustmentTransactionDataType } from '../_speakeasy_enums'; +import type { Customers } from './customers'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface TrackingRefAdjustmentTransaction + */ +export interface TrackingRefAdjustmentTransaction { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier. + * @type {string} + * @memberof TrackingRefAdjustmentTransaction + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRefAdjustmentTransaction + */ + dataType?: TrackingRefAdjustmentTransactionDataType; +} + /** - * The type of the linked reference + * @export */ -export const TrackingRefAdjustmentTransactionDataType = { - TrackingCategories: "trackingCategories", - Customers: "customers", - Suppliers: "suppliers", +export const TrackingRefAdjustmentTransactionDataTypeEnum = { + TrackingCategories: 'trackingCategories', + Customers: 'customers', + Suppliers: 'suppliers' } as const; +export type TrackingRefAdjustmentTransactionDataTypeEnum = typeof TrackingRefAdjustmentTransactionDataTypeEnum[keyof typeof TrackingRefAdjustmentTransactionDataTypeEnum]; + + /** - * The type of the linked reference + * Check if a given object implements the TrackingRefAdjustmentTransaction interface. */ -export type TrackingRefAdjustmentTransactionDataType = ClosedEnum< - typeof TrackingRefAdjustmentTransactionDataType ->; +export function instanceOfTrackingRefAdjustmentTransaction(value: object): value is TrackingRefAdjustmentTransaction { + return true; +} -export type TrackingRefAdjustmentTransaction = { - /** - * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier. - */ - id?: string | undefined; - /** - * The type of the linked reference - */ - dataType?: TrackingRefAdjustmentTransactionDataType | undefined; -}; +export function TrackingRefAdjustmentTransactionFromJSON(json: any): TrackingRefAdjustmentTransaction { + return TrackingRefAdjustmentTransactionFromJSONTyped(json, false); +} -/** @internal */ -export const TrackingRefAdjustmentTransactionDataType$outboundSchema: - z.ZodNativeEnum = z - .nativeEnum(TrackingRefAdjustmentTransactionDataType); +export function TrackingRefAdjustmentTransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrackingRefAdjustmentTransaction { + if (json == null) { + return json; + } + return { + + 'id': json['id'] == null ? undefined : json['id'], + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + }; +} -/** @internal */ -export type TrackingRefAdjustmentTransaction$Outbound = { - id?: string | undefined; - dataType: string; -}; +export function TrackingRefAdjustmentTransactionToJSON(json: any): TrackingRefAdjustmentTransaction { + return TrackingRefAdjustmentTransactionToJSONTyped(json, false); +} + +export function TrackingRefAdjustmentTransactionToJSONTyped(value?: TrackingRefAdjustmentTransaction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'id': value['id'], + 'dataType': value['dataType'], + }; +} -/** @internal */ -export const TrackingRefAdjustmentTransaction$outboundSchema: z.ZodType< - TrackingRefAdjustmentTransaction$Outbound, - z.ZodTypeDef, - TrackingRefAdjustmentTransaction -> = z.object({ - id: z.string().optional(), - dataType: TrackingRefAdjustmentTransactionDataType$outboundSchema.default( - "trackingCategories", - ), -}); -export function trackingRefAdjustmentTransactionToJSON( - trackingRefAdjustmentTransaction: TrackingRefAdjustmentTransaction, -): string { - return JSON.stringify( - TrackingRefAdjustmentTransaction$outboundSchema.parse( - trackingRefAdjustmentTransaction, - ), - ); +export interface AdjustmentTransactionLineTrackingRefAdjustmentTransaction { + /** + * Unique identifier of the linked reference from mapping options or the unique identifier of the linked customer or supplier. + * @type {string} + * @memberof TrackingRefAdjustmentTransaction + */ + id?: string; + /** + * The type of the linked reference + * @type {string} + * @memberof TrackingRefAdjustmentTransaction + */ + dataType?: TrackingRefAdjustmentTransactionDataType; } diff --git a/sync-for-expenses/src/sdk/models/shared/transaction.ts b/sync-for-expenses/src/sdk/models/shared/transaction.ts index 7f205c6f3..07566d75a 100644 --- a/sync-for-expenses/src/sdk/models/shared/transaction.ts +++ b/sync-for-expenses/src/sdk/models/shared/transaction.ts @@ -1,59 +1,333 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { TransactionStatus } from './transactionstatus'; import { - IntegrationType, - IntegrationType$inboundSchema, -} from "./integrationtype.js"; + TransactionStatusFromJSON, + TransactionStatusFromJSONTyped, + TransactionStatusToJSON, + TransactionStatusToJSONTyped, +} from './transactionstatus'; +import type { IntegrationType } from './integrationtype'; import { - TransactionStatus, - TransactionStatus$inboundSchema, -} from "./transactionstatus.js"; - -export type Transaction = { - /** - * Your unique idenfier of the transaction. - */ - transactionId?: string | null | undefined; - /** - * Status of the transaction. - */ - status?: TransactionStatus | null | undefined; - /** - * Metadata such as validation errors or the resulting record created in the accounting software. - */ - message?: string | null | undefined; - /** - * Type of transaction that has been processed e.g. Expense or Bank Feed. - */ - integrationType: IntegrationType | null; -}; - -/** @internal */ -export const Transaction$inboundSchema: z.ZodType< - Transaction, - z.ZodTypeDef, - unknown -> = z.object({ - transactionId: z.nullable(z.string()).optional(), - status: z.nullable(TransactionStatus$inboundSchema).optional(), - message: z.nullable(z.string()).optional(), - integrationType: z.nullable( - IntegrationType$inboundSchema.default("expenses"), - ), -}); - -export function transactionFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Transaction$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Transaction' from JSON`, - ); + IntegrationTypeFromJSON, + IntegrationTypeFromJSONTyped, + IntegrationTypeToJSON, + IntegrationTypeToJSONTyped, +} from './integrationtype'; + +/** + * + * @export + * @interface Transaction + */ +export interface Transaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + + + +/** + * Check if a given object implements the Transaction interface. + */ +export function instanceOfTransaction(value: object): value is Transaction { + return true; +} + +export function TransactionFromJSON(json: any): Transaction { + return TransactionFromJSONTyped(json, false); +} + +export function TransactionFromJSONTyped(json: any, ignoreDiscriminator: boolean): Transaction { + if (json == null) { + return json; + } + return { + + ...json, + 'transactionId': json['transactionId'] == null ? undefined : json['transactionId'], + 'status': json['status'] == null ? undefined : TransactionStatusFromJSON(json['status']), + 'message': json['message'] == null ? undefined : json['message'], + 'integrationType': json['integrationType'] == null ? undefined : IntegrationTypeFromJSON(json['integrationType']), + }; +} + +export function TransactionToJSON(json: any): Transaction { + return TransactionToJSONTyped(json, false); +} + +export function TransactionToJSONTyped(value?: Transaction | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'transactionId': value['transactionId'], + 'status': TransactionStatusToJSON(value['status']), + 'message': value['message'], + 'integrationType': IntegrationTypeToJSON(value['integrationType']), + }; +} + + +export interface ExpensesSyncWebhookTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface GetSyncTransactionResponseTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface ListSyncTransactionsResponseTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface SyncTransactionGetResponseTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface SyncTransactionsListResponseTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface TransactionResponse { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface TransactionResponseTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; +} + +export interface TransactionsTransaction { + [key: string]: any | any; + /** + * Your unique idenfier of the transaction. + * @type {string} + * @memberof Transaction + */ + transactionId?: string | null; + /** + * + * @type {TransactionStatus} + * @memberof Transaction + */ + status?: TransactionStatus | null; + /** + * Metadata such as validation errors or the resulting record created in the accounting software. + * @type {string} + * @memberof Transaction + */ + message?: string | null; + /** + * + * @type {IntegrationType} + * @memberof Transaction + */ + integrationType?: IntegrationType | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/transactions.ts b/sync-for-expenses/src/sdk/models/shared/transactions.ts index e88e27437..03f6e8b8d 100644 --- a/sync-for-expenses/src/sdk/models/shared/transactions.ts +++ b/sync-for-expenses/src/sdk/models/shared/transactions.ts @@ -1,55 +1,187 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { remap as remap$ } from "../../../lib/primitives.js"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Links, Links$inboundSchema } from "./links.js"; -import { Transaction, Transaction$inboundSchema } from "./transaction.js"; - -export type Transactions = { - results?: Array | undefined; - /** - * Current page number. - */ - pageNumber: number; - /** - * Number of items to return in results array. - */ - pageSize: number; - /** - * Total number of items. - */ - totalResults: number; - links: Links; -}; - -/** @internal */ -export const Transactions$inboundSchema: z.ZodType< - Transactions, - z.ZodTypeDef, - unknown -> = z.object({ - results: z.array(Transaction$inboundSchema).optional(), - pageNumber: z.number().int(), - pageSize: z.number().int(), - totalResults: z.number().int(), - _links: Links$inboundSchema, -}).transform((v) => { - return remap$(v, { - "_links": "links", - }); -}); - -export function transactionsFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Transactions$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Transactions' from JSON`, - ); +import { mapValues } from '../../../runtime'; +import type { Transaction } from './transaction'; +import { + TransactionFromJSON, + TransactionFromJSONTyped, + TransactionToJSON, + TransactionToJSONTyped, +} from './transaction'; +import type { Links } from './links'; +import { + LinksFromJSON, + LinksFromJSONTyped, + LinksToJSON, + LinksToJSONTyped, +} from './links'; + +/** + * + * @export + * @interface Transactions + */ +export interface Transactions { + [key: string]: any | any; + /** + * Current page number. + * @type {number} + * @memberof Transactions + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Transactions + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Transactions + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Transactions + */ + links: Links; + /** + * + * @type {Array} + * @memberof Transactions + */ + results?: Array; +} + +/** + * Check if a given object implements the Transactions interface. + */ +export function instanceOfTransactions(value: object): value is Transactions { + if (!('pageNumber' in value) || value['pageNumber'] === undefined) return false; + if (!('pageSize' in value) || value['pageSize'] === undefined) return false; + if (!('totalResults' in value) || value['totalResults'] === undefined) return false; + if (!('links' in value) || value['links'] === undefined) return false; + return true; +} + +export function TransactionsFromJSON(json: any): Transactions { + return TransactionsFromJSONTyped(json, false); +} + +export function TransactionsFromJSONTyped(json: any, ignoreDiscriminator: boolean): Transactions { + if (json == null) { + return json; + } + return { + + ...json, + 'pageNumber': json['pageNumber'], + 'pageSize': json['pageSize'], + 'totalResults': json['totalResults'], + 'links': LinksFromJSON(json['_links']), + 'results': json['results'] == null ? undefined : ((json['results'] as Array).map(TransactionFromJSON)), + }; +} + +export function TransactionsToJSON(json: any): Transactions { + return TransactionsToJSONTyped(json, false); +} + +export function TransactionsToJSONTyped(value?: Transactions | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'pageNumber': value['pageNumber'], + 'pageSize': value['pageSize'], + 'totalResults': value['totalResults'], + '_links': LinksToJSON(value['links']), + 'results': value['results'] == null ? undefined : ((value['results'] as Array).map(TransactionToJSON)), + }; +} + + +export interface ListSyncTransactionsResponseTransactions { + [key: string]: any | any; + /** + * Current page number. + * @type {number} + * @memberof Transactions + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Transactions + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Transactions + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Transactions + */ + links: Links; + /** + * + * @type {Array} + * @memberof Transactions + */ + results?: Array; +} + +export interface SyncTransactionsListResponseTransactions { + [key: string]: any | any; + /** + * Current page number. + * @type {number} + * @memberof Transactions + */ + pageNumber: number; + /** + * Number of items to return in results array. + * @type {number} + * @memberof Transactions + */ + pageSize: number; + /** + * Total number of items. + * @type {number} + * @memberof Transactions + */ + totalResults: number; + /** + * + * @type {Links} + * @memberof Transactions + */ + links: Links; + /** + * + * @type {Array} + * @memberof Transactions + */ + results?: Array; } diff --git a/sync-for-expenses/src/sdk/models/shared/transactionstatus.ts b/sync-for-expenses/src/sdk/models/shared/transactionstatus.ts index a3c87f729..ba4a18ba2 100644 --- a/sync-for-expenses/src/sdk/models/shared/transactionstatus.ts +++ b/sync-for-expenses/src/sdk/models/shared/transactionstatus.ts @@ -1,26 +1,56 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; /** * Status of the transaction. + * @export */ export const TransactionStatus = { - Unknown: "Unknown", - Pending: "Pending", - ValidationError: "ValidationError", - Completed: "Completed", - PushError: "PushError", + Unknown: 'Unknown', + Pending: 'Pending', + ValidationError: 'ValidationError', + Completed: 'Completed', + PushError: 'PushError' } as const; -/** - * Status of the transaction. - */ -export type TransactionStatus = ClosedEnum; +export type TransactionStatus = typeof TransactionStatus[keyof typeof TransactionStatus]; + + +export function instanceOfTransactionStatus(value: any): boolean { + for (const key in TransactionStatus) { + if (Object.prototype.hasOwnProperty.call(TransactionStatus, key)) { + if (TransactionStatus[key as keyof typeof TransactionStatus] === value) { + return true; + } + } + } + return false; +} + +export function TransactionStatusFromJSON(json: any): TransactionStatus { + return TransactionStatusFromJSONTyped(json, false); +} + +export function TransactionStatusFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransactionStatus { + return json as TransactionStatus; +} + +export function TransactionStatusToJSON(value?: TransactionStatus | null): any { + return value as any; +} + +export function TransactionStatusToJSONTyped(value: any, ignoreDiscriminator: boolean): TransactionStatus { + return value as TransactionStatus; +} -/** @internal */ -export const TransactionStatus$inboundSchema: z.ZodNativeEnum< - typeof TransactionStatus -> = z.nativeEnum(TransactionStatus); diff --git a/sync-for-expenses/src/sdk/models/shared/transfertransactionrequest.ts b/sync-for-expenses/src/sdk/models/shared/transfertransactionrequest.ts index 1f8432823..c7eb9b2f2 100644 --- a/sync-for-expenses/src/sdk/models/shared/transfertransactionrequest.ts +++ b/sync-for-expenses/src/sdk/models/shared/transfertransactionrequest.ts @@ -1,174 +1,244 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; +import type { From } from '../TransferTransactionRequestFrom'; +import type { To } from '../TransferTransactionRequestTo'; +import { mapValues } from '../../../runtime'; +import type { TransferTransactionRequestFrom } from '../TransferTransactionRequestFrom'; +import { + TransferTransactionRequestFromFromJSON, + TransferTransactionRequestFromFromJSONTyped, + TransferTransactionRequestFromToJSON, + TransferTransactionRequestFromToJSONTyped, +} from '../TransferTransactionRequestFrom'; +import type { TransferTransactionRequestTo } from '../TransferTransactionRequestTo'; +import { + TransferTransactionRequestToFromJSON, + TransferTransactionRequestToFromJSONTyped, + TransferTransactionRequestToToJSON, + TransferTransactionRequestToToJSONTyped, +} from '../TransferTransactionRequestTo'; /** - * Reference of the account you are transferring money from. + * + * @export + * @interface TransferTransactionRequest */ -export type AccountReference = { - /** - * 'id' from the Accounts data type. - */ - id: string; -}; - -export type From = { - /** - * Reference of the account you are transferring money from. - */ - accountRef: AccountReference; - /** - * Amount that has been transferred from the account in the native currency of the account. - */ - amount: Decimal$ | number; -}; +export interface TransferTransactionRequest { + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof TransferTransactionRequest + */ + description?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof TransferTransactionRequest + */ + date: string; + /** + * + * @type {TransferTransactionRequestFrom} + * @memberof TransferTransactionRequest + */ + from: From; + /** + * + * @type {TransferTransactionRequestTo} + * @memberof TransferTransactionRequest + */ + to: To; +} /** - * Reference of the account you are transferring money to. + * Check if a given object implements the TransferTransactionRequest interface. */ -export type TransferTransactionRequestAccountReference = { - /** - * 'id' from the Accounts data type. - */ - id: string; -}; - -export type To = { - /** - * Reference of the account you are transferring money to. - */ - accountRef: TransferTransactionRequestAccountReference; - /** - * Amount that has been transferred to the account in the native currency of the account. - */ - amount: Decimal$ | number; -}; - -export type TransferTransactionRequest = { - /** - * Any private, company notes about the transaction. - */ - description?: string | undefined; - date: string; - from: From; - to: To; -}; - -/** @internal */ -export type AccountReference$Outbound = { - id: string; -}; - -/** @internal */ -export const AccountReference$outboundSchema: z.ZodType< - AccountReference$Outbound, - z.ZodTypeDef, - AccountReference -> = z.object({ - id: z.string(), -}); - -export function accountReferenceToJSON( - accountReference: AccountReference, -): string { - return JSON.stringify( - AccountReference$outboundSchema.parse(accountReference), - ); +export function instanceOfTransferTransactionRequest(value: object): value is TransferTransactionRequest { + if (!('date' in value) || value['date'] === undefined) return false; + if (!('from' in value) || value['from'] === undefined) return false; + if (!('to' in value) || value['to'] === undefined) return false; + return true; } -/** @internal */ -export type From$Outbound = { - accountRef: AccountReference$Outbound; - amount: number; -}; - -/** @internal */ -export const From$outboundSchema: z.ZodType = - z.object({ - accountRef: z.lazy(() => AccountReference$outboundSchema), - amount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - }); - -export function fromToJSON(from: From): string { - return JSON.stringify(From$outboundSchema.parse(from)); +export function TransferTransactionRequestFromJSON(json: any): TransferTransactionRequest { + return TransferTransactionRequestFromJSONTyped(json, false); } -/** @internal */ -export type TransferTransactionRequestAccountReference$Outbound = { - id: string; -}; +export function TransferTransactionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransferTransactionRequest { + if (json == null) { + return json; + } + return { + + 'description': json['description'] == null ? undefined : json['description'], + 'date': json['date'], + 'from': TransferTransactionRequestFromFromJSON(json['from']), + 'to': TransferTransactionRequestToFromJSON(json['to']), + }; +} -/** @internal */ -export const TransferTransactionRequestAccountReference$outboundSchema: - z.ZodType< - TransferTransactionRequestAccountReference$Outbound, - z.ZodTypeDef, - TransferTransactionRequestAccountReference - > = z.object({ - id: z.string(), - }); +export function TransferTransactionRequestToJSON(json: any): TransferTransactionRequest { + return TransferTransactionRequestToJSONTyped(json, false); +} -export function transferTransactionRequestAccountReferenceToJSON( - transferTransactionRequestAccountReference: - TransferTransactionRequestAccountReference, -): string { - return JSON.stringify( - TransferTransactionRequestAccountReference$outboundSchema.parse( - transferTransactionRequestAccountReference, - ), - ); +export function TransferTransactionRequestToJSONTyped(value?: TransferTransactionRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'description': value['description'], + 'date': value['date'], + 'from': TransferTransactionRequestFromToJSON(value['from']), + 'to': TransferTransactionRequestToToJSON(value['to']), + }; } -/** @internal */ -export type To$Outbound = { - accountRef: TransferTransactionRequestAccountReference$Outbound; - amount: number; -}; -/** @internal */ -export const To$outboundSchema: z.ZodType = z - .object({ - accountRef: z.lazy(() => - TransferTransactionRequestAccountReference$outboundSchema - ), - amount: z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - }); +export interface CreateTransferTransactionRequestBody { + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof TransferTransactionRequest + */ + description?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof TransferTransactionRequest + */ + date: string; + /** + * + * @type {TransferTransactionRequestFrom} + * @memberof TransferTransactionRequest + */ + from: TransferTransactionRequestFrom; + /** + * + * @type {TransferTransactionRequestTo} + * @memberof TransferTransactionRequest + */ + to: TransferTransactionRequestTo; +} -export function toToJSON(to: To): string { - return JSON.stringify(To$outboundSchema.parse(to)); +export interface CreateTransferTransactionTransferTransactionRequest { + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof TransferTransactionRequest + */ + description?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof TransferTransactionRequest + */ + date: string; + /** + * + * @type {TransferTransactionRequestFrom} + * @memberof TransferTransactionRequest + */ + from: TransferTransactionRequestFrom; + /** + * + * @type {TransferTransactionRequestTo} + * @memberof TransferTransactionRequest + */ + to: TransferTransactionRequestTo; } -/** @internal */ -export type TransferTransactionRequest$Outbound = { - description?: string | undefined; - date: string; - from: From$Outbound; - to: To$Outbound; -}; +export interface Transfer { + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof TransferTransactionRequest + */ + description?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof TransferTransactionRequest + */ + date: string; + /** + * + * @type {TransferTransactionRequestFrom} + * @memberof TransferTransactionRequest + */ + from: TransferTransactionRequestFrom; + /** + * + * @type {TransferTransactionRequestTo} + * @memberof TransferTransactionRequest + */ + to: TransferTransactionRequestTo; +} -/** @internal */ -export const TransferTransactionRequest$outboundSchema: z.ZodType< - TransferTransactionRequest$Outbound, - z.ZodTypeDef, - TransferTransactionRequest -> = z.object({ - description: z.string().optional(), - date: z.string(), - from: z.lazy(() => From$outboundSchema), - to: z.lazy(() => To$outboundSchema), -}); +export interface TransferTransactionCreateRequestBody { + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof TransferTransactionRequest + */ + description?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof TransferTransactionRequest + */ + date: string; + /** + * + * @type {TransferTransactionRequestFrom} + * @memberof TransferTransactionRequest + */ + from: TransferTransactionRequestFrom; + /** + * + * @type {TransferTransactionRequestTo} + * @memberof TransferTransactionRequest + */ + to: TransferTransactionRequestTo; +} -export function transferTransactionRequestToJSON( - transferTransactionRequest: TransferTransactionRequest, -): string { - return JSON.stringify( - TransferTransactionRequest$outboundSchema.parse(transferTransactionRequest), - ); +export interface TransferTransactionRequestTransfer { + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof TransferTransactionRequest + */ + description?: string; + /** + * Date of the transfer transaction as recorded in the accounting software. + * @type {string} + * @memberof TransferTransactionRequest + */ + date: string; + /** + * + * @type {TransferTransactionRequestFrom} + * @memberof TransferTransactionRequest + */ + from: TransferTransactionRequestFrom; + /** + * + * @type {TransferTransactionRequestTo} + * @memberof TransferTransactionRequest + */ + to: TransferTransactionRequestTo; } diff --git a/sync-for-expenses/src/sdk/models/shared/transfertransactionresponse.ts b/sync-for-expenses/src/sdk/models/shared/transfertransactionresponse.ts index 4356c2411..7eb2a5440 100644 --- a/sync-for-expenses/src/sdk/models/shared/transfertransactionresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/transfertransactionresponse.ts @@ -1,34 +1,119 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type TransferTransactionResponse = { - /** - * Unique id of sync created - */ - syncId?: string | undefined; -}; - -/** @internal */ -export const TransferTransactionResponse$inboundSchema: z.ZodType< - TransferTransactionResponse, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string().optional(), -}); - -export function transferTransactionResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => TransferTransactionResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'TransferTransactionResponse' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface TransferTransactionResponse + */ +export interface TransferTransactionResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; +} + +/** + * Check if a given object implements the TransferTransactionResponse interface. + */ +export function instanceOfTransferTransactionResponse(value: object): value is TransferTransactionResponse { + return true; +} + +export function TransferTransactionResponseFromJSON(json: any): TransferTransactionResponse { + return TransferTransactionResponseFromJSONTyped(json, false); +} + +export function TransferTransactionResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TransferTransactionResponse { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + }; +} + +export function TransferTransactionResponseToJSON(json: any): TransferTransactionResponse { + return TransferTransactionResponseToJSONTyped(json, false); +} + +export function TransferTransactionResponseToJSONTyped(value?: TransferTransactionResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + }; +} + + +export interface CreateTransferResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; +} + +export interface CreateTransferTransactionResponseCreateTransferResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; +} + +export interface CreateTransferTransactionResponseTransferTransactionResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; +} + +export interface TransferTransactionCreateResponseCreateTransferResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; +} + +export interface TransferTransactionCreateResponseTransferTransactionResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; +} + +export interface TransferTransactionResponseCreateTransferResponse { + /** + * Unique id of sync created + * @type {string} + * @memberof TransferTransactionResponse + */ + syncId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/updatecustomerresponse.ts b/sync-for-expenses/src/sdk/models/shared/updatecustomerresponse.ts index 3057b181e..386980de0 100644 --- a/sync-for-expenses/src/sdk/models/shared/updatecustomerresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/updatecustomerresponse.ts @@ -1,276 +1,439 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Contact, Contact$inboundSchema } from "./contact.js"; -import { - CustomerStatus, - CustomerStatus$inboundSchema, -} from "./customerstatus.js"; -import { Items, Items$inboundSchema } from "./items.js"; -import { Metadata, Metadata$inboundSchema } from "./metadata.js"; +import type { UpdateCustomerResponseAccountingCustomer } from './customer'; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { UpdateCustomerResponseAllOfData } from '../UpdateCustomerResponseAllOfData'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; + UpdateCustomerResponseAllOfDataFromJSON, + UpdateCustomerResponseAllOfDataFromJSONTyped, + UpdateCustomerResponseAllOfDataToJSON, + UpdateCustomerResponseAllOfDataToJSONTyped, +} from '../UpdateCustomerResponseAllOfData'; +import type { PushOperationChange } from './pushoperationchange'; import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * ## Overview - * - * @remarks - * - * A customer is a person or organisation that buys goods or services. From the Customers endpoints, you can retrieve a [list of all the customers of a company](https://api.codat.io/swagger/index.html#/Customers/get_companies__companyId__data_customers). - * - * Customers' data links to accounts receivable [invoices](https://docs.codat.io/sync-for-expenses-api#/schemas/Invoice). - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * + * @export + * @interface UpdateCustomerResponse */ -export type UpdateCustomerResponseAccountingCustomer = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the customer, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the customer as recorded in the accounting system, typically the company name. - */ - customerName?: string | null | undefined; - /** - * Name of the main contact for the identified customer. - */ - contactName?: string | null | undefined; - /** - * Email address the customer can be contacted by. - */ - emailAddress?: string | null | undefined; - /** - * The currency data type in Codat is the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code, e.g. _GBP_. - * - * @remarks - * - * ## 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. - */ - defaultCurrency?: string | undefined; - /** - * Phone number the customer can be contacted by. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * An array of Contacts. - */ - contacts?: Array | null | undefined; - /** - * Company number. In the UK, this is typically the Companies House company registration number. - */ - registrationNumber?: string | null | undefined; - /** - * Company tax number. - */ - taxNumber?: string | null | undefined; - /** - * Status of customer. - */ - status: CustomerStatus; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; +export interface UpdateCustomerResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof UpdateCustomerResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof UpdateCustomerResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof UpdateCustomerResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof UpdateCustomerResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof UpdateCustomerResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof UpdateCustomerResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof UpdateCustomerResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateCustomerResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateCustomerResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof UpdateCustomerResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof UpdateCustomerResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof UpdateCustomerResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof UpdateCustomerResponse + */ + statusCode: number; + /** + * + * @type {UpdateCustomerResponseAllOfData} + * @memberof UpdateCustomerResponse + */ + data?: UpdateCustomerResponseAccountingCustomer | null; +} + -export type UpdateCustomerResponse = { - data?: UpdateCustomerResponseAccountingCustomer | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; +/** + * @export + */ +export const UpdateCustomerResponseDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type UpdateCustomerResponseDataTypeEnum = typeof UpdateCustomerResponseDataTypeEnum[keyof typeof UpdateCustomerResponseDataTypeEnum]; -/** @internal */ -export const UpdateCustomerResponseAccountingCustomer$inboundSchema: z.ZodType< - UpdateCustomerResponseAccountingCustomer, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - customerName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - defaultCurrency: z.string().optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$inboundSchema)).optional(), - contacts: z.nullable(z.array(Contact$inboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: CustomerStatus$inboundSchema, - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); -export function updateCustomerResponseAccountingCustomerFromJSON( - jsonString: string, -): SafeParseResult< - UpdateCustomerResponseAccountingCustomer, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - UpdateCustomerResponseAccountingCustomer$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'UpdateCustomerResponseAccountingCustomer' from JSON`, - ); +/** + * Check if a given object implements the UpdateCustomerResponse interface. + */ +export function instanceOfUpdateCustomerResponse(value: object): value is UpdateCustomerResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function UpdateCustomerResponseFromJSON(json: any): UpdateCustomerResponse { + return UpdateCustomerResponseFromJSONTyped(json, false); +} + +export function UpdateCustomerResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateCustomerResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : UpdateCustomerResponseAllOfDataFromJSON(json['data']), + }; +} + +export function UpdateCustomerResponseToJSON(json: any): UpdateCustomerResponse { + return UpdateCustomerResponseToJSONTyped(json, false); +} + +export function UpdateCustomerResponseToJSONTyped(value?: UpdateCustomerResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': UpdateCustomerResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const UpdateCustomerResponse$inboundSchema: z.ZodType< - UpdateCustomerResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable( - z.lazy(() => UpdateCustomerResponseAccountingCustomer$inboundSchema), - ).optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); -export function updateCustomerResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateCustomerResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateCustomerResponse' from JSON`, - ); +export interface CustomerUpdateResponseUpdateCustomerResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof UpdateCustomerResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof UpdateCustomerResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof UpdateCustomerResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof UpdateCustomerResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof UpdateCustomerResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof UpdateCustomerResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof UpdateCustomerResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateCustomerResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateCustomerResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof UpdateCustomerResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof UpdateCustomerResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof UpdateCustomerResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof UpdateCustomerResponse + */ + statusCode: number; + /** + * + * @type {UpdateCustomerResponseAllOfData} + * @memberof UpdateCustomerResponse + */ + data?: UpdateCustomerResponseAllOfData | null; +} + +export interface UpdateCustomerResponseUpdateCustomerResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof UpdateCustomerResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof UpdateCustomerResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof UpdateCustomerResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof UpdateCustomerResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof UpdateCustomerResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof UpdateCustomerResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof UpdateCustomerResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateCustomerResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateCustomerResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof UpdateCustomerResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof UpdateCustomerResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof UpdateCustomerResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof UpdateCustomerResponse + */ + statusCode: number; + /** + * + * @type {UpdateCustomerResponseAllOfData} + * @memberof UpdateCustomerResponse + */ + data?: UpdateCustomerResponseAllOfData | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/updateexpenserequest.ts b/sync-for-expenses/src/sdk/models/shared/updateexpenserequest.ts index 119ee0aeb..edd317850 100644 --- a/sync-for-expenses/src/sdk/models/shared/updateexpenserequest.ts +++ b/sync-for-expenses/src/sdk/models/shared/updateexpenserequest.ts @@ -1,181 +1,641 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { ClosedEnum } from "../../types/enums.js"; +import type { UpdateExpenseRequestBankAccountReference } from './bankaccountreference'; +import type { UpdateExpenseRequestType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +import { Decimal, toDecimal, fromDecimal } from '../../../runtime'; +import type { BankAccountReference } from './bankaccountreference'; +import { + BankAccountReferenceFromJSON, + BankAccountReferenceFromJSONTyped, + BankAccountReferenceToJSON, + BankAccountReferenceToJSONTyped, +} from './bankaccountreference'; +import type { ExpenseTransactionLine } from './expensetransactionline'; import { - ExpenseContactRef, - ExpenseContactRef$Outbound, - ExpenseContactRef$outboundSchema, -} from "./expensecontactref.js"; + ExpenseTransactionLineFromJSON, + ExpenseTransactionLineFromJSONTyped, + ExpenseTransactionLineToJSON, + ExpenseTransactionLineToJSONTyped, +} from './expensetransactionline'; +import type { ExpenseContactRef } from './expensecontactref'; import { - ExpenseTransactionLine, - ExpenseTransactionLine$Outbound, - ExpenseTransactionLine$outboundSchema, -} from "./expensetransactionline.js"; + ExpenseContactRefFromJSON, + ExpenseContactRefFromJSONTyped, + ExpenseContactRefToJSON, + ExpenseContactRefToJSONTyped, +} from './expensecontactref'; + +/** + * + * @export + * @interface UpdateExpenseRequest + */ +export interface UpdateExpenseRequest { + /** + * The type of transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + type: UpdateExpenseRequestType; + /** + * Date the transaction was recorded. + * @type {string} + * @memberof UpdateExpenseRequest + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateExpenseRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateExpenseRequest + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or Customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof UpdateExpenseRequest + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof UpdateExpenseRequest + */ + bankAccountRef?: UpdateExpenseRequestBankAccountReference; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof UpdateExpenseRequest + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateExpenseRequest + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + notes?: string; +} + /** - * The type of transaction. + * @export */ -export const UpdateExpenseRequestType = { - Payment: "Payment", - Refund: "Refund", - Reward: "Reward", - Chargeback: "Chargeback", +export const UpdateExpenseRequestTypeEnum = { + Payment: 'Payment', + Refund: 'Refund', + Reward: 'Reward', + Chargeback: 'Chargeback' } as const; +export type UpdateExpenseRequestTypeEnum = typeof UpdateExpenseRequestTypeEnum[keyof typeof UpdateExpenseRequestTypeEnum]; + + /** - * The type of transaction. + * Check if a given object implements the UpdateExpenseRequest interface. */ -export type UpdateExpenseRequestType = ClosedEnum< - typeof UpdateExpenseRequestType ->; - -export type UpdateExpenseRequestBankAccountReference = { - /** - * Identifier of the bank account. - */ - id?: string | undefined; -}; - -export type UpdateExpenseRequest = { - /** - * The type of transaction. - */ - type: UpdateExpenseRequestType; - /** - * Date the transaction was recorded. - */ - issueDate: string; - /** - * Currency the transaction was recorded in. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - contactRef?: ExpenseContactRef | undefined; - bankAccountRef?: UpdateExpenseRequestBankAccountReference | undefined; - /** - * Name of the merchant where the purchase took place - */ - merchantName?: string | undefined; - /** - * Array of transaction lines. - */ - lines?: Array | undefined; - /** - * Any private, company notes about the transaction. - */ - notes?: string | undefined; -}; - -/** @internal */ -export const UpdateExpenseRequestType$outboundSchema: z.ZodNativeEnum< - typeof UpdateExpenseRequestType -> = z.nativeEnum(UpdateExpenseRequestType); - -/** @internal */ -export type UpdateExpenseRequestBankAccountReference$Outbound = { - id?: string | undefined; -}; - -/** @internal */ -export const UpdateExpenseRequestBankAccountReference$outboundSchema: z.ZodType< - UpdateExpenseRequestBankAccountReference$Outbound, - z.ZodTypeDef, - UpdateExpenseRequestBankAccountReference -> = z.object({ - id: z.string().optional(), -}); - -export function updateExpenseRequestBankAccountReferenceToJSON( - updateExpenseRequestBankAccountReference: - UpdateExpenseRequestBankAccountReference, -): string { - return JSON.stringify( - UpdateExpenseRequestBankAccountReference$outboundSchema.parse( - updateExpenseRequestBankAccountReference, - ), - ); +export function instanceOfUpdateExpenseRequest(value: object): value is UpdateExpenseRequest { + if (!('type' in value) || value['type'] === undefined) return false; + if (!('issueDate' in value) || value['issueDate'] === undefined) return false; + if (!('currency' in value) || value['currency'] === undefined) return false; + return true; +} + +export function UpdateExpenseRequestFromJSON(json: any): UpdateExpenseRequest { + return UpdateExpenseRequestFromJSONTyped(json, false); +} + +export function UpdateExpenseRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateExpenseRequest { + if (json == null) { + return json; + } + return { + + 'type': json['type'], + 'issueDate': json['issueDate'], + 'currency': json['currency'], + 'currencyRate': json['currencyRate'] == null ? undefined : toDecimal(json['currencyRate']), + 'contactRef': json['contactRef'] == null ? undefined : ExpenseContactRefFromJSON(json['contactRef']), + 'bankAccountRef': json['bankAccountRef'] == null ? undefined : BankAccountReferenceFromJSON(json['bankAccountRef']), + 'merchantName': json['merchantName'] == null ? undefined : json['merchantName'], + 'lines': json['lines'] == null ? undefined : ((json['lines'] as Array).map(ExpenseTransactionLineFromJSON)), + 'notes': json['notes'] == null ? undefined : json['notes'], + }; +} + +export function UpdateExpenseRequestToJSON(json: any): UpdateExpenseRequest { + return UpdateExpenseRequestToJSONTyped(json, false); +} + +export function UpdateExpenseRequestToJSONTyped(value?: UpdateExpenseRequest | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': value['type'], + 'issueDate': value['issueDate'], + 'currency': value['currency'], + 'currencyRate': fromDecimal(value['currencyRate']), + 'contactRef': ExpenseContactRefToJSON(value['contactRef']), + 'bankAccountRef': BankAccountReferenceToJSON(value['bankAccountRef']), + 'merchantName': value['merchantName'], + 'lines': value['lines'] == null ? undefined : ((value['lines'] as Array).map(ExpenseTransactionLineToJSON)), + 'notes': value['notes'], + }; +} + + +export interface ExpenseTransactionUpdateRequestBody { + /** + * The type of transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + type: UpdateExpenseRequestType; + /** + * Date the transaction was recorded. + * @type {string} + * @memberof UpdateExpenseRequest + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateExpenseRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateExpenseRequest + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or Customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof UpdateExpenseRequest + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof UpdateExpenseRequest + */ + bankAccountRef?: BankAccountReference; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof UpdateExpenseRequest + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateExpenseRequest + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + notes?: string; +} + +export interface UpdateExpenseRequestUpdatingExpenseTransactionRequest { + /** + * The type of transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + type: UpdateExpenseRequestType; + /** + * Date the transaction was recorded. + * @type {string} + * @memberof UpdateExpenseRequest + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateExpenseRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateExpenseRequest + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or Customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof UpdateExpenseRequest + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof UpdateExpenseRequest + */ + bankAccountRef?: BankAccountReference; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof UpdateExpenseRequest + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateExpenseRequest + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + notes?: string; +} + +export interface UpdateExpenseTransactionRequestBody { + /** + * The type of transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + type: UpdateExpenseRequestType; + /** + * Date the transaction was recorded. + * @type {string} + * @memberof UpdateExpenseRequest + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateExpenseRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateExpenseRequest + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or Customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof UpdateExpenseRequest + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof UpdateExpenseRequest + */ + bankAccountRef?: BankAccountReference; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof UpdateExpenseRequest + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateExpenseRequest + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + notes?: string; +} + +export interface UpdateExpenseTransactionUpdateExpenseRequest { + /** + * The type of transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + type: UpdateExpenseRequestType; + /** + * Date the transaction was recorded. + * @type {string} + * @memberof UpdateExpenseRequest + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateExpenseRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateExpenseRequest + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or Customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof UpdateExpenseRequest + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof UpdateExpenseRequest + */ + bankAccountRef?: BankAccountReference; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof UpdateExpenseRequest + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateExpenseRequest + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + notes?: string; } -/** @internal */ -export type UpdateExpenseRequest$Outbound = { - type: string; - issueDate: string; - currency: string; - currencyRate?: number | null | undefined; - contactRef?: ExpenseContactRef$Outbound | undefined; - bankAccountRef?: - | UpdateExpenseRequestBankAccountReference$Outbound - | undefined; - merchantName?: string | undefined; - lines?: Array | undefined; - notes?: string | undefined; -}; - -/** @internal */ -export const UpdateExpenseRequest$outboundSchema: z.ZodType< - UpdateExpenseRequest$Outbound, - z.ZodTypeDef, - UpdateExpenseRequest -> = z.object({ - type: UpdateExpenseRequestType$outboundSchema, - issueDate: z.string(), - currency: z.string(), - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - contactRef: ExpenseContactRef$outboundSchema.optional(), - bankAccountRef: z.lazy(() => - UpdateExpenseRequestBankAccountReference$outboundSchema - ).optional(), - merchantName: z.string().optional(), - lines: z.array(ExpenseTransactionLine$outboundSchema).optional(), - notes: z.string().optional(), -}); - -export function updateExpenseRequestToJSON( - updateExpenseRequest: UpdateExpenseRequest, -): string { - return JSON.stringify( - UpdateExpenseRequest$outboundSchema.parse(updateExpenseRequest), - ); +export interface UpdatingExpenseTransactionRequest { + /** + * The type of transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + type: UpdateExpenseRequestType; + /** + * Date the transaction was recorded. + * @type {string} + * @memberof UpdateExpenseRequest + */ + issueDate: string; + /** + * Currency the transaction was recorded in. + * @type {string} + * @memberof UpdateExpenseRequest + */ + currency: string; + /** + * 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. | + * @type {number} + * @memberof UpdateExpenseRequest + */ + currencyRate?: Decimal | number | null; + /** + * Supplier or Customer for the purchase to be associated to. + * @type {ExpenseContactRef} + * @memberof UpdateExpenseRequest + */ + contactRef?: ExpenseContactRef; + /** + * + * @type {BankAccountReference} + * @memberof UpdateExpenseRequest + */ + bankAccountRef?: BankAccountReference; + /** + * Name of the merchant where the purchase took place + * @type {string} + * @memberof UpdateExpenseRequest + */ + merchantName?: string; + /** + * Array of transaction lines. + * @type {Array} + * @memberof UpdateExpenseRequest + */ + lines?: Array; + /** + * Any private, company notes about the transaction. + * @type {string} + * @memberof UpdateExpenseRequest + */ + notes?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/updateexpenseresponse.ts b/sync-for-expenses/src/sdk/models/shared/updateexpenseresponse.ts index 4843efea0..981e97942 100644 --- a/sync-for-expenses/src/sdk/models/shared/updateexpenseresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/updateexpenseresponse.ts @@ -1,34 +1,83 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type UpdateExpenseResponse = { - /** - * Unique identifier for the update expense sync. - */ - syncId?: string | undefined; -}; - -/** @internal */ -export const UpdateExpenseResponse$inboundSchema: z.ZodType< - UpdateExpenseResponse, - z.ZodTypeDef, - unknown -> = z.object({ - syncId: z.string().optional(), -}); - -export function updateExpenseResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateExpenseResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateExpenseResponse' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface UpdateExpenseResponse + */ +export interface UpdateExpenseResponse { + /** + * Unique identifier for the update expense sync. + * @type {string} + * @memberof UpdateExpenseResponse + */ + syncId?: string; +} + +/** + * Check if a given object implements the UpdateExpenseResponse interface. + */ +export function instanceOfUpdateExpenseResponse(value: object): value is UpdateExpenseResponse { + return true; +} + +export function UpdateExpenseResponseFromJSON(json: any): UpdateExpenseResponse { + return UpdateExpenseResponseFromJSONTyped(json, false); +} + +export function UpdateExpenseResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateExpenseResponse { + if (json == null) { + return json; + } + return { + + 'syncId': json['syncId'] == null ? undefined : json['syncId'], + }; +} + +export function UpdateExpenseResponseToJSON(json: any): UpdateExpenseResponse { + return UpdateExpenseResponseToJSONTyped(json, false); +} + +export function UpdateExpenseResponseToJSONTyped(value?: UpdateExpenseResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'syncId': value['syncId'], + }; +} + + +export interface ExpenseTransactionUpdateResponseUpdateExpenseResponse { + /** + * Unique identifier for the update expense sync. + * @type {string} + * @memberof UpdateExpenseResponse + */ + syncId?: string; +} + +export interface UpdateExpenseTransactionResponseUpdateExpenseResponse { + /** + * Unique identifier for the update expense sync. + * @type {string} + * @memberof UpdateExpenseResponse + */ + syncId?: string; } diff --git a/sync-for-expenses/src/sdk/models/shared/updatereimbursableexpensetransactionrequest.ts b/sync-for-expenses/src/sdk/models/shared/updatereimbursableexpensetransactionrequest.ts deleted file mode 100644 index 1b58eaa21..000000000 --- a/sync-for-expenses/src/sdk/models/shared/updatereimbursableexpensetransactionrequest.ts +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { Decimal as Decimal$ } from "../../types/decimal.js"; -import { - ApAccountRef, - ApAccountRef$Outbound, - ApAccountRef$outboundSchema, -} from "./apaccountref.js"; -import { - ReimbursableExpenseTransactionLine, - ReimbursableExpenseTransactionLine$Outbound, - ReimbursableExpenseTransactionLine$outboundSchema, -} from "./reimbursableexpensetransactionline.js"; -import { - ReimbursementContactRef, - ReimbursementContactRef$Outbound, - ReimbursementContactRef$outboundSchema, -} from "./reimbursementcontactref.js"; - -export type UpdateReimbursableExpenseTransactionRequest = { - /** - * User-friendly reference for the reimbursable expense. - */ - reference?: string | null | undefined; - contactRef: ReimbursementContactRef; - apAccountRef?: ApAccountRef | null | undefined; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - issueDate: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > 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; - /** - * Currency the transaction was recorded in. - */ - currency: string; - /** - * Rate to convert the total amount of the payment into the base currency for the company at the time of the payment. - * - * @remarks - * - * 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. | - */ - currencyRate?: Decimal$ | number | null | undefined; - /** - * Any private, company notes about the transaction. - */ - notes?: string | undefined; - /** - * Array of transaction lines. - */ - lines?: Array | undefined; -}; - -/** @internal */ -export type UpdateReimbursableExpenseTransactionRequest$Outbound = { - reference?: string | null | undefined; - contactRef: ReimbursementContactRef$Outbound; - apAccountRef?: ApAccountRef$Outbound | null | undefined; - issueDate: string; - dueDate: string; - currency: string; - currencyRate?: number | null | undefined; - notes?: string | undefined; - lines?: Array | undefined; -}; - -/** @internal */ -export const UpdateReimbursableExpenseTransactionRequest$outboundSchema: - z.ZodType< - UpdateReimbursableExpenseTransactionRequest$Outbound, - z.ZodTypeDef, - UpdateReimbursableExpenseTransactionRequest - > = z.object({ - reference: z.nullable(z.string()).optional(), - contactRef: ReimbursementContactRef$outboundSchema, - apAccountRef: z.nullable(ApAccountRef$outboundSchema).optional(), - issueDate: z.string(), - dueDate: z.string(), - currency: z.string(), - currencyRate: z.nullable( - z.union([z.instanceof(Decimal$), z.number()]).transform(v => - typeof v === "number" ? v : v.toNumber() - ), - ).optional(), - notes: z.string().optional(), - lines: z.array(ReimbursableExpenseTransactionLine$outboundSchema) - .optional(), - }); - -export function updateReimbursableExpenseTransactionRequestToJSON( - updateReimbursableExpenseTransactionRequest: - UpdateReimbursableExpenseTransactionRequest, -): string { - return JSON.stringify( - UpdateReimbursableExpenseTransactionRequest$outboundSchema.parse( - updateReimbursableExpenseTransactionRequest, - ), - ); -} diff --git a/sync-for-expenses/src/sdk/models/shared/updatesupplierresponse.ts b/sync-for-expenses/src/sdk/models/shared/updatesupplierresponse.ts index 249e30240..85f2d3686 100644 --- a/sync-for-expenses/src/sdk/models/shared/updatesupplierresponse.ts +++ b/sync-for-expenses/src/sdk/models/shared/updatesupplierresponse.ts @@ -1,260 +1,439 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; -import { Items, Items$inboundSchema } from "./items.js"; -import { Metadata, Metadata$inboundSchema } from "./metadata.js"; +import type { UpdateSupplierResponseAccountingSupplier } from './supplier'; +import type { PropertieDataType } from '../_speakeasy_enums'; +import type { Company } from './company'; +import type { Customers } from './customers'; +import type { Items } from './items'; +import type { Suppliers } from './suppliers'; +import { mapValues } from '../../../runtime'; +import type { Validation } from './validation'; import { - PropertieDataType, - PropertieDataType$inboundSchema, -} from "./propertiedatatype.js"; + ValidationFromJSON, + ValidationFromJSONTyped, + ValidationToJSON, + ValidationToJSONTyped, +} from './validation'; +import type { PushOperationStatus } from './pushoperationstatus'; import { - PushOperationChange, - PushOperationChange$inboundSchema, -} from "./pushoperationchange.js"; + PushOperationStatusFromJSON, + PushOperationStatusFromJSONTyped, + PushOperationStatusToJSON, + PushOperationStatusToJSONTyped, +} from './pushoperationstatus'; +import type { UpdateSupplierResponseAllOfData } from '../UpdateSupplierResponseAllOfData'; import { - PushOperationStatus, - PushOperationStatus$inboundSchema, -} from "./pushoperationstatus.js"; + UpdateSupplierResponseAllOfDataFromJSON, + UpdateSupplierResponseAllOfDataFromJSONTyped, + UpdateSupplierResponseAllOfDataToJSON, + UpdateSupplierResponseAllOfDataToJSONTyped, +} from '../UpdateSupplierResponseAllOfData'; +import type { PushOperationChange } from './pushoperationchange'; import { - SupplementalData, - SupplementalData$inboundSchema, -} from "./supplementaldata.js"; -import { - SupplierStatus, - SupplierStatus$inboundSchema, -} from "./supplierstatus.js"; -import { Validation, Validation$inboundSchema } from "./validation.js"; + PushOperationChangeFromJSON, + PushOperationChangeFromJSONTyped, + PushOperationChangeToJSON, + PushOperationChangeToJSONTyped, +} from './pushoperationchange'; /** - * ## Overview - * - * @remarks - * - * From the **Suppliers** endpoints, you can retrieve a list of [all the suppliers for a company](https://docs.codat.io/sync-for-expenses-api#/operations/list-suppliers). Suppliers' data links to accounts payable [bills](https://docs.codat.io/sync-for-expenses-api#/schemas/Bill). - * - * @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible. + * + * @export + * @interface UpdateSupplierResponse + */ +export interface UpdateSupplierResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof UpdateSupplierResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof UpdateSupplierResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof UpdateSupplierResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof UpdateSupplierResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof UpdateSupplierResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof UpdateSupplierResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof UpdateSupplierResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateSupplierResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateSupplierResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof UpdateSupplierResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof UpdateSupplierResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof UpdateSupplierResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof UpdateSupplierResponse + */ + statusCode: number; + /** + * + * @type {UpdateSupplierResponseAllOfData} + * @memberof UpdateSupplierResponse + */ + data?: UpdateSupplierResponseAccountingSupplier | null; +} + + +/** + * @export */ -export type UpdateSupplierResponseAccountingSupplier = { - modifiedDate?: string | undefined; - sourceModifiedDate?: string | undefined; - /** - * Identifier for the supplier, unique to the company in the accounting software. - */ - id?: string | undefined; - /** - * Name of the supplier as recorded in the accounting system, typically the company name. - */ - supplierName?: string | null | undefined; - /** - * Name of the main contact for the supplier. - */ - contactName?: string | null | undefined; - /** - * Email address that the supplier may be contacted on. - */ - emailAddress?: string | null | undefined; - /** - * Phone number that the supplier may be contacted on. - */ - phone?: string | null | undefined; - /** - * An array of Addresses. - */ - addresses?: Array | null | undefined; - /** - * Company number of the supplier. In the UK, this is typically the company registration number issued by Companies House. - */ - registrationNumber?: string | null | undefined; - /** - * Supplier's company tax number. - */ - taxNumber?: string | null | undefined; - /** - * Status of the supplier. - */ - status: SupplierStatus; - /** - * Default currency the supplier's transactional data is recorded in. - */ - defaultCurrency?: string | null | undefined; - metadata?: Metadata | undefined; - /** - * Supplemental data is additional data you can include in our standard data types. - * - * @remarks - * - * 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 | undefined; -}; +export const UpdateSupplierResponseDataTypeEnum = { + AccountTransactions: 'accountTransactions', + BalanceSheet: 'balanceSheet', + BankAccounts: 'bankAccounts', + BankTransactions: 'bankTransactions', + BillCreditNotes: 'billCreditNotes', + BillPayments: 'billPayments', + Bills: 'bills', + CashFlowStatement: 'cashFlowStatement', + ChartOfAccounts: 'chartOfAccounts', + Company: 'company', + CreditNotes: 'creditNotes', + Customers: 'customers', + DirectCosts: 'directCosts', + DirectIncomes: 'directIncomes', + Invoices: 'invoices', + ItemReceipts: 'itemReceipts', + Items: 'items', + JournalEntries: 'journalEntries', + Journals: 'journals', + PaymentMethods: 'paymentMethods', + Payments: 'payments', + ProfitAndLoss: 'profitAndLoss', + PurchaseOrders: 'purchaseOrders', + SalesOrders: 'salesOrders', + Suppliers: 'suppliers', + TaxRates: 'taxRates', + TrackingCategories: 'trackingCategories', + Transfers: 'transfers', + BankingAccountBalances: 'banking-accountBalances', + BankingAccounts: 'banking-accounts', + BankingTransactionCategories: 'banking-transactionCategories', + BankingTransactions: 'banking-transactions', + CommerceCompanyInfo: 'commerce-companyInfo', + CommerceCustomers: 'commerce-customers', + CommerceDisputes: 'commerce-disputes', + CommerceLocations: 'commerce-locations', + CommerceOrders: 'commerce-orders', + CommercePaymentMethods: 'commerce-paymentMethods', + CommercePayments: 'commerce-payments', + CommerceProductCategories: 'commerce-productCategories', + CommerceProducts: 'commerce-products', + CommerceTaxComponents: 'commerce-taxComponents', + CommerceTransactions: 'commerce-transactions' +} as const; +export type UpdateSupplierResponseDataTypeEnum = typeof UpdateSupplierResponseDataTypeEnum[keyof typeof UpdateSupplierResponseDataTypeEnum]; -export type UpdateSupplierResponse = { - data?: UpdateSupplierResponseAccountingSupplier | null | undefined; - /** - * Contains a single entry that communicates which record has changed and the manner in which it changed. - */ - changes?: Array | null | undefined; - /** - * Available data types - */ - dataType?: PropertieDataType | undefined; - /** - * Unique identifier for your SMB in Codat. - */ - companyId: string; - /** - * 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. - */ - pushOperationKey: string; - /** - * Unique identifier for a company's data connection. - */ - dataConnectionKey: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - requestedOnUtc: string; - /** - * In Codat's data model, dates and times are represented using the ISO 8601 standard. Date and time fields are formatted as strings; for example: - * - * @remarks - * - * ``` - * 2020-10-08T22:40:50Z - * 2021-01-01T00:00:00 - * ``` - * - * When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information: - * - * - Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z` - * - Unqualified local time: `2021-11-15T01:00:00` - * - UTC time offsets: `2021-11-15T01:00:00-05:00` - * - * > Time zones - * > - * > Not all dates from Codat will contain information about time zones. - * > Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. - */ - completedOnUtc?: string | undefined; - /** - * Number of minutes the push operation must complete within before it times out. - */ - timeoutInMinutes?: number | null | undefined; - /** - * Number of seconds the push operation must complete within before it times out. - * - * @deprecated field: This will be removed in a future release, please migrate away from it as soon as possible. - */ - timeoutInSeconds?: number | null | undefined; - /** - * The current status of the push operation. - */ - status: PushOperationStatus; - /** - * A message about the error. - */ - errorMessage?: string | null | undefined; - /** - * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. - */ - validation?: Validation | undefined; - /** - * Push status code. - */ - statusCode: number; -}; -/** @internal */ -export const UpdateSupplierResponseAccountingSupplier$inboundSchema: z.ZodType< - UpdateSupplierResponseAccountingSupplier, - z.ZodTypeDef, - unknown -> = z.object({ - modifiedDate: z.string().optional(), - sourceModifiedDate: z.string().optional(), - id: z.string().optional(), - supplierName: z.nullable(z.string()).optional(), - contactName: z.nullable(z.string()).optional(), - emailAddress: z.nullable(z.string()).optional(), - phone: z.nullable(z.string()).optional(), - addresses: z.nullable(z.array(Items$inboundSchema)).optional(), - registrationNumber: z.nullable(z.string()).optional(), - taxNumber: z.nullable(z.string()).optional(), - status: SupplierStatus$inboundSchema, - defaultCurrency: z.nullable(z.string()).optional(), - metadata: Metadata$inboundSchema.optional(), - supplementalData: SupplementalData$inboundSchema.optional(), -}); +/** + * Check if a given object implements the UpdateSupplierResponse interface. + */ +export function instanceOfUpdateSupplierResponse(value: object): value is UpdateSupplierResponse { + if (!('companyId' in value) || value['companyId'] === undefined) return false; + if (!('pushOperationKey' in value) || value['pushOperationKey'] === undefined) return false; + if (!('dataConnectionKey' in value) || value['dataConnectionKey'] === undefined) return false; + if (!('requestedOnUtc' in value) || value['requestedOnUtc'] === undefined) return false; + if (!('status' in value) || value['status'] === undefined) return false; + if (!('statusCode' in value) || value['statusCode'] === undefined) return false; + return true; +} + +export function UpdateSupplierResponseFromJSON(json: any): UpdateSupplierResponse { + return UpdateSupplierResponseFromJSONTyped(json, false); +} + +export function UpdateSupplierResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateSupplierResponse { + if (json == null) { + return json; + } + return { + + 'changes': json['changes'] == null ? undefined : ((json['changes'] as Array).map(PushOperationChangeFromJSON)), + 'dataType': json['dataType'] == null ? undefined : json['dataType'], + 'companyId': json['companyId'], + 'pushOperationKey': json['pushOperationKey'], + 'dataConnectionKey': json['dataConnectionKey'], + 'requestedOnUtc': json['requestedOnUtc'], + 'completedOnUtc': json['completedOnUtc'] == null ? undefined : json['completedOnUtc'], + 'timeoutInMinutes': json['timeoutInMinutes'] == null ? undefined : json['timeoutInMinutes'], + 'timeoutInSeconds': json['timeoutInSeconds'] == null ? undefined : json['timeoutInSeconds'], + 'status': PushOperationStatusFromJSON(json['status']), + 'errorMessage': json['errorMessage'] == null ? undefined : json['errorMessage'], + 'validation': json['validation'] == null ? undefined : ValidationFromJSON(json['validation']), + 'statusCode': json['statusCode'], + 'data': json['data'] == null ? undefined : UpdateSupplierResponseAllOfDataFromJSON(json['data']), + }; +} + +export function UpdateSupplierResponseToJSON(json: any): UpdateSupplierResponse { + return UpdateSupplierResponseToJSONTyped(json, false); +} -export function updateSupplierResponseAccountingSupplierFromJSON( - jsonString: string, -): SafeParseResult< - UpdateSupplierResponseAccountingSupplier, - SDKValidationError -> { - return safeParse( - jsonString, - (x) => - UpdateSupplierResponseAccountingSupplier$inboundSchema.parse( - JSON.parse(x), - ), - `Failed to parse 'UpdateSupplierResponseAccountingSupplier' from JSON`, - ); +export function UpdateSupplierResponseToJSONTyped(value?: UpdateSupplierResponse | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'changes': value['changes'] == null ? undefined : ((value['changes'] as Array).map(PushOperationChangeToJSON)), + 'dataType': value['dataType'], + 'companyId': value['companyId'], + 'pushOperationKey': value['pushOperationKey'], + 'dataConnectionKey': value['dataConnectionKey'], + 'requestedOnUtc': value['requestedOnUtc'], + 'completedOnUtc': value['completedOnUtc'], + 'timeoutInMinutes': value['timeoutInMinutes'], + 'timeoutInSeconds': value['timeoutInSeconds'], + 'status': PushOperationStatusToJSON(value['status']), + 'errorMessage': value['errorMessage'], + 'validation': ValidationToJSON(value['validation']), + 'statusCode': value['statusCode'], + 'data': UpdateSupplierResponseAllOfDataToJSON(value['data']), + }; } -/** @internal */ -export const UpdateSupplierResponse$inboundSchema: z.ZodType< - UpdateSupplierResponse, - z.ZodTypeDef, - unknown -> = z.object({ - data: z.nullable( - z.lazy(() => UpdateSupplierResponseAccountingSupplier$inboundSchema), - ).optional(), - changes: z.nullable(z.array(PushOperationChange$inboundSchema)).optional(), - dataType: PropertieDataType$inboundSchema.optional(), - companyId: z.string(), - pushOperationKey: z.string(), - dataConnectionKey: z.string(), - requestedOnUtc: z.string(), - completedOnUtc: z.string().optional(), - timeoutInMinutes: z.nullable(z.number().int()).optional(), - timeoutInSeconds: z.nullable(z.number().int()).optional(), - status: PushOperationStatus$inboundSchema, - errorMessage: z.nullable(z.string()).optional(), - validation: Validation$inboundSchema.optional(), - statusCode: z.number().int(), -}); -export function updateSupplierResponseFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => UpdateSupplierResponse$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'UpdateSupplierResponse' from JSON`, - ); +export interface SupplierUpdateResponseUpdateSupplierResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof UpdateSupplierResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof UpdateSupplierResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof UpdateSupplierResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof UpdateSupplierResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof UpdateSupplierResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof UpdateSupplierResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof UpdateSupplierResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateSupplierResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateSupplierResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof UpdateSupplierResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof UpdateSupplierResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof UpdateSupplierResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof UpdateSupplierResponse + */ + statusCode: number; + /** + * + * @type {UpdateSupplierResponseAllOfData} + * @memberof UpdateSupplierResponse + */ + data?: UpdateSupplierResponseAllOfData | null; +} + +export interface UpdateSupplierResponseUpdateSupplierResponse { + /** + * Contains a single entry that communicates which record has changed and the manner in which it changed. + * @type {Array} + * @memberof UpdateSupplierResponse + */ + changes?: Array | null; + /** + * Available data types + * @type {string} + * @memberof UpdateSupplierResponse + */ + dataType?: PropertieDataType; + /** + * Unique identifier for your SMB in Codat. + * @type {string} + * @memberof UpdateSupplierResponse + */ + companyId: string; + /** + * 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. + * @type {string} + * @memberof UpdateSupplierResponse + */ + pushOperationKey: string; + /** + * Unique identifier for a company's data connection. + * @type {string} + * @memberof UpdateSupplierResponse + */ + dataConnectionKey: string; + /** + * The datetime when the push was requested. + * @type {string} + * @memberof UpdateSupplierResponse + */ + requestedOnUtc: string; + /** + * The datetime when the push was completed, null if Pending. + * @type {string} + * @memberof UpdateSupplierResponse + */ + completedOnUtc?: string; + /** + * Number of minutes the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateSupplierResponse + */ + timeoutInMinutes?: number | null; + /** + * Number of seconds the push operation must complete within before it times out. + * @type {number} + * @memberof UpdateSupplierResponse + * @deprecated + */ + timeoutInSeconds?: number | null; + /** + * + * @type {PushOperationStatus} + * @memberof UpdateSupplierResponse + */ + status: PushOperationStatus; + /** + * A message about the error. + * @type {string} + * @memberof UpdateSupplierResponse + */ + errorMessage?: string | null; + /** + * + * @type {Validation} + * @memberof UpdateSupplierResponse + */ + validation?: Validation; + /** + * Push status code. + * @type {number} + * @memberof UpdateSupplierResponse + */ + statusCode: number; + /** + * + * @type {UpdateSupplierResponseAllOfData} + * @memberof UpdateSupplierResponse + */ + data?: UpdateSupplierResponseAllOfData | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/validation.ts b/sync-for-expenses/src/sdk/models/shared/validation.ts index 3a6a92030..9a3664b29 100644 --- a/sync-for-expenses/src/sdk/models/shared/validation.ts +++ b/sync-for-expenses/src/sdk/models/shared/validation.ts @@ -1,40 +1,321 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; +import { mapValues } from '../../../runtime'; +import type { ValidationItem } from './validationitem'; import { - ValidationItem, - ValidationItem$inboundSchema, -} from "./validationitem.js"; + ValidationItemFromJSON, + ValidationItemFromJSONTyped, + ValidationItemToJSON, + ValidationItemToJSONTyped, +} from './validationitem'; /** * A human-readable object describing validation decisions Codat has made when pushing data into the platform. If a push has failed because of validation errors, they will be detailed here. + * @export + * @interface Validation + */ +export interface Validation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +/** + * Check if a given object implements the Validation interface. */ -export type Validation = { - errors?: Array | null | undefined; - warnings?: Array | null | undefined; -}; - -/** @internal */ -export const Validation$inboundSchema: z.ZodType< - Validation, - z.ZodTypeDef, - unknown -> = z.object({ - errors: z.nullable(z.array(ValidationItem$inboundSchema)).optional(), - warnings: z.nullable(z.array(ValidationItem$inboundSchema)).optional(), -}); - -export function validationFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => Validation$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'Validation' from JSON`, - ); +export function instanceOfValidation(value: object): value is Validation { + return true; +} + +export function ValidationFromJSON(json: any): Validation { + return ValidationFromJSONTyped(json, false); +} + +export function ValidationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Validation { + if (json == null) { + return json; + } + return { + + 'errors': json['errors'] == null ? undefined : ((json['errors'] as Array).map(ValidationItemFromJSON)), + 'warnings': json['warnings'] == null ? undefined : ((json['warnings'] as Array).map(ValidationItemFromJSON)), + }; +} + +export function ValidationToJSON(json: any): Validation { + return ValidationToJSONTyped(json, false); +} + +export function ValidationToJSONTyped(value?: Validation | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'errors': value['errors'] == null ? undefined : ((value['errors'] as Array).map(ValidationItemToJSON)), + 'warnings': value['warnings'] == null ? undefined : ((value['warnings'] as Array).map(ValidationItemToJSON)), + }; +} + + +export interface AccountCreateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface BankAccountCreateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateAccountResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateBankAccountResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateCustomerResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CreateSupplierResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CustomerCreateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface CustomerUpdateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface GetPushOperationResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationGetResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface PushOperationsValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface SupplierCreateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface SupplierUpdateResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface UpdateCustomerResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; +} + +export interface UpdateSupplierResponseValidation { + /** + * + * @type {Array} + * @memberof Validation + */ + errors?: Array | null; + /** + * + * @type {Array} + * @memberof Validation + */ + warnings?: Array | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/validationitem.ts b/sync-for-expenses/src/sdk/models/shared/validationitem.ts index ca354aa0b..a91a10bcc 100644 --- a/sync-for-expenses/src/sdk/models/shared/validationitem.ts +++ b/sync-for-expenses/src/sdk/models/shared/validationitem.ts @@ -1,44 +1,238 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. */ -import * as z from "zod/v3"; -import { safeParse } from "../../../lib/schemas.js"; -import { Result as SafeParseResult } from "../../types/fp.js"; -import { SDKValidationError } from "../errors/sdkvalidationerror.js"; - -export type ValidationItem = { - /** - * Unique identifier for a validation item. - */ - itemId?: string | null | undefined; - /** - * A message outlining validation item's issue. - */ - message?: string | null | undefined; - /** - * Name of validator. - */ - validatorName?: string | null | undefined; -}; - -/** @internal */ -export const ValidationItem$inboundSchema: z.ZodType< - ValidationItem, - z.ZodTypeDef, - unknown -> = z.object({ - itemId: z.nullable(z.string()).optional(), - message: z.nullable(z.string()).optional(), - validatorName: z.nullable(z.string()).optional(), -}); - -export function validationItemFromJSON( - jsonString: string, -): SafeParseResult { - return safeParse( - jsonString, - (x) => ValidationItem$inboundSchema.parse(JSON.parse(x)), - `Failed to parse 'ValidationItem' from JSON`, - ); +import { mapValues } from '../../../runtime'; +/** + * + * @export + * @interface ValidationItem + */ +export interface ValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +/** + * Check if a given object implements the ValidationItem interface. + */ +export function instanceOfValidationItem(value: object): value is ValidationItem { + return true; +} + +export function ValidationItemFromJSON(json: any): ValidationItem { + return ValidationItemFromJSONTyped(json, false); +} + +export function ValidationItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidationItem { + if (json == null) { + return json; + } + return { + + ...json, + 'itemId': json['itemId'] == null ? undefined : json['itemId'], + 'message': json['message'] == null ? undefined : json['message'], + 'validatorName': json['validatorName'] == null ? undefined : json['validatorName'], + }; +} + +export function ValidationItemToJSON(json: any): ValidationItem { + return ValidationItemToJSONTyped(json, false); +} + +export function ValidationItemToJSONTyped(value?: ValidationItem | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + ...value, + 'itemId': value['itemId'], + 'message': value['message'], + 'validatorName': value['validatorName'], + }; +} + + +export interface CreateAccountResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface CreateBankAccountResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface CreateCustomerResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface CreateSupplierResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface PushOperationValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface UpdateCustomerResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; +} + +export interface UpdateSupplierResponseValidationItem { + [key: string]: any | any; + /** + * Unique identifier for a validation item. + * @type {string} + * @memberof ValidationItem + */ + itemId?: string | null; + /** + * A message outlining validation item's issue. + * @type {string} + * @memberof ValidationItem + */ + message?: string | null; + /** + * Name of validator. + * @type {string} + * @memberof ValidationItem + */ + validatorName?: string | null; } diff --git a/sync-for-expenses/src/sdk/models/shared/validdatatypelinks.ts b/sync-for-expenses/src/sdk/models/shared/validdatatypelinks.ts new file mode 100644 index 000000000..6fa006264 --- /dev/null +++ b/sync-for-expenses/src/sdk/models/shared/validdatatypelinks.ts @@ -0,0 +1,157 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { mapValues } from '../../../runtime'; +/** + * When querying Codat's data model, some data types return `validDatatypeLinks` metadata in the JSON response. This indicates where that object can be used as a reference—a _valid link_—when creating or updating other data. + * + * For example, `validDatatypeLinks` might indicate the following references: + * + * - Which tax rates are valid to use on the line item of a bill. + * - Which items can be used when creating an invoice. + * + * You can use `validDatatypeLinks` to present your SMB customers with only valid choices when selecting objects from a list, for example. + * + * ## `validDatatypeLinks` example + * + * The following example uses the `Accounting.Accounts` data type. It shows that, on the linked integration, this account is valid as the account on a payment or bill payment; and as the account referenced on the line item of a direct income or direct cost. Because there is no valid link to Invoices or Bills, using this account on those data types will result in an error. + * + * ```json validDatatypeLinks for an account + * { + * "id": "bd9e85e0-0478-433d-ae9f-0b3c4f04bfe4", + * "nominalCode": "090", + * "name": "Business Bank Account", + * #... + * "validDatatypeLinks": [ + * { + * "property": "Id", + * "links": [ + * "Payment.AccountRef.Id", + * "BillPayment.AccountRef.Id", + * "DirectIncome.LineItems.AccountRef.Id", + * "DirectCost.LineItems.AccountRef.Id" + * ] + * } + * ] + * } + * ``` + * + * + * + * ## Support for `validDatatypeLinks` + * + * Codat currently supports `validDatatypeLinks` for some data types on our Xero, QuickBooks Online, QuickBooks Desktop, Exact (NL), and Sage Business Cloud integrations. + * + * If you'd like us to extend support to more data types or integrations, suggest or vote for this on our Product Roadmap. + * @export + * @interface ValidDataTypeLinks + */ +export interface ValidDataTypeLinks { + /** + * The property from the account that can be linked. + * @type {string} + * @memberof ValidDataTypeLinks + */ + property?: string | null; + /** + * Supported `dataTypes` that the record can be linked to. + * @type {Array} + * @memberof ValidDataTypeLinks + */ + links?: Array | null; +} + +/** + * Check if a given object implements the ValidDataTypeLinks interface. + */ +export function instanceOfValidDataTypeLinks(value: object): value is ValidDataTypeLinks { + return true; +} + +export function ValidDataTypeLinksFromJSON(json: any): ValidDataTypeLinks { + return ValidDataTypeLinksFromJSONTyped(json, false); +} + +export function ValidDataTypeLinksFromJSONTyped(json: any, ignoreDiscriminator: boolean): ValidDataTypeLinks { + if (json == null) { + return json; + } + return { + + 'property': json['property'] == null ? undefined : json['property'], + 'links': json['links'] == null ? undefined : json['links'], + }; +} + +export function ValidDataTypeLinksToJSON(json: any): ValidDataTypeLinks { + return ValidDataTypeLinksToJSONTyped(json, false); +} + +export function ValidDataTypeLinksToJSONTyped(value?: ValidDataTypeLinks | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'property': value['property'], + 'links': value['links'], + }; +} + + +export interface AccountValidDataTypeLinks { + /** + * The property from the account that can be linked. + * @type {string} + * @memberof ValidDataTypeLinks + */ + property?: string | null; + /** + * Supported `dataTypes` that the record can be linked to. + * @type {Array} + * @memberof ValidDataTypeLinks + */ + links?: Array | null; +} + +export interface AccountingAccountValidDataTypeLinks { + /** + * The property from the account that can be linked. + * @type {string} + * @memberof ValidDataTypeLinks + */ + property?: string | null; + /** + * Supported `dataTypes` that the record can be linked to. + * @type {Array} + * @memberof ValidDataTypeLinks + */ + links?: Array | null; +} + +export interface CreateAccountResponseValidDataTypeLinks { + /** + * The property from the account that can be linked. + * @type {string} + * @memberof ValidDataTypeLinks + */ + property?: string | null; + /** + * Supported `dataTypes` that the record can be linked to. + * @type {Array} + * @memberof ValidDataTypeLinks + */ + links?: Array | null; +} diff --git a/sync-for-expenses/src/sdk/models/shared/validfor.ts b/sync-for-expenses/src/sdk/models/shared/validfor.ts deleted file mode 100644 index cc19074ad..000000000 --- a/sync-for-expenses/src/sdk/models/shared/validfor.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -export const ValidFor = { - ExpenseTransactionsPayment: "expense-transactions.Payment", - ExpenseTransactionsRefund: "expense-transactions.Refund", - ExpenseTransactionsReward: "expense-transactions.Reward", - ExpenseTransactionsChargeback: "expense-transactions.Chargeback", - ReimbursableExpenseTransactions: "reimbursable-expense-transactions", - TransferTransactions: "transfer-transactions", - AdjustmentTransactions: "adjustment-transactions", -} as const; -export type ValidFor = ClosedEnum; - -/** @internal */ -export const ValidFor$inboundSchema: z.ZodNativeEnum = z - .nativeEnum(ValidFor); diff --git a/sync-for-expenses/src/sdk/models/shared/validtransactiontypes.ts b/sync-for-expenses/src/sdk/models/shared/validtransactiontypes.ts deleted file mode 100644 index d113dc779..000000000 --- a/sync-for-expenses/src/sdk/models/shared/validtransactiontypes.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { ClosedEnum } from "../../types/enums.js"; - -export const ValidTransactionTypes = { - Payment: "Payment", - Refund: "Refund", - Reward: "Reward", - Chargeback: "Chargeback", -} as const; -export type ValidTransactionTypes = ClosedEnum; - -/** @internal */ -export const ValidTransactionTypes$inboundSchema: z.ZodNativeEnum< - typeof ValidTransactionTypes -> = z.nativeEnum(ValidTransactionTypes); diff --git a/sync-for-expenses/src/sdk/models/shared/weblink.ts b/sync-for-expenses/src/sdk/models/shared/weblink.ts new file mode 100644 index 000000000..ea8ec13cd --- /dev/null +++ b/sync-for-expenses/src/sdk/models/shared/weblink.ts @@ -0,0 +1,146 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Expenses + * The API for Codat\'s Expenses solution. Expenses is an API and a set of supporting tools. It has been built to enable corporate card and expense management platforms to provide high-quality integrations with multiple accounting software through a standardized API. [Explore solution](https://docs.codat.io/sync-for-expenses/overview) | [See our OpenAPI spec](https://github.com/codatio/oas) Not seeing the endpoints you\'re expecting? We\'ve [reorganized our solutions](https://docs.codat.io/updates/230901-new-products), and you may be using a [different version of Expenses](https://docs.codat.io/sync-for-expenses-v1-api#/). --- ## Endpoints | Endpoints | Description | | :- |:- | | Companies | Create and manage your SMB users\' companies. | | Connections | Create new and manage existing data connections for a company. | | Configuration | View and manage mapping configuration and defaults for expense transactions. | | Sync | Monitor the status of data syncs. | | Expenses | Create and update transactions that represent your customers\' spend. | | Transfers | Create and update transactions that represent the movement of your customers\' money. | | Reimbursements | Create and update transactions that represent your customers\' repayable spend. | | Attachments | Attach receipts to a transaction for a complete audit trail. | | Transaction status | Monitor the status of individual transactions in data syncs. | | Manage data | Control and monitor the retrieval of data from an integration. | | Push operations | View historic push operations. | | Accounts | Create accounts and view account schemas. | | Customers | Get, create, and update customers. | | Suppliers | Get, create, and update suppliers. | + * + * The version of the OpenAPI document: prealpha + * Contact: expenses@codat.io + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import type { CompanyInformationType } from '../_speakeasy_enums'; +import { mapValues } from '../../../runtime'; +/** + * Weblink associated with the company. + * @export + * @interface Weblink + */ +export interface Weblink { + /** + * The type of the weblink. + * @type {string} + * @memberof Weblink + */ + type?: CompanyInformationType; + /** + * The full URL for the weblink. + * @type {string} + * @memberof Weblink + */ + url?: string; +} + + +/** + * @export + */ +export const WeblinkTypeEnum = { + Website: 'Website', + Social: 'Social', + Unknown: 'Unknown' +} as const; +export type WeblinkTypeEnum = typeof WeblinkTypeEnum[keyof typeof WeblinkTypeEnum]; + + +/** + * Check if a given object implements the Weblink interface. + */ +export function instanceOfWeblink(value: object): value is Weblink { + return true; +} + +export function WeblinkFromJSON(json: any): Weblink { + return WeblinkFromJSONTyped(json, false); +} + +export function WeblinkFromJSONTyped(json: any, ignoreDiscriminator: boolean): Weblink { + if (json == null) { + return json; + } + return { + + 'type': json['type'] == null ? undefined : json['type'], + 'url': json['url'] == null ? undefined : json['url'], + }; +} + +export function WeblinkToJSON(json: any): Weblink { + return WeblinkToJSONTyped(json, false); +} + +export function WeblinkToJSONTyped(value?: Weblink | null, ignoreDiscriminator: boolean = false): any { + if (value == null) { + return value; + } + + return { + + 'type': value['type'], + 'url': value['url'], + }; +} + + +export interface AccountingCompanyInformationWeblink { + /** + * The type of the weblink. + * @type {string} + * @memberof Weblink + */ + type?: CompanyInformationType; + /** + * The full URL for the weblink. + * @type {string} + * @memberof Weblink + */ + url?: string; +} + +export interface CompanyInfoGetResponseWeblink { + /** + * The type of the weblink. + * @type {string} + * @memberof Weblink + */ + type?: CompanyInformationType; + /** + * The full URL for the weblink. + * @type {string} + * @memberof Weblink + */ + url?: string; +} + +export interface CompanyInformationWeblink { + /** + * The type of the weblink. + * @type {string} + * @memberof Weblink + */ + type?: CompanyInformationType; + /** + * The full URL for the weblink. + * @type {string} + * @memberof Weblink + */ + url?: string; +} + +export interface GetCompanyInfoResponseWeblink { + /** + * The type of the weblink. + * @type {string} + * @memberof Weblink + */ + type?: CompanyInformationType; + /** + * The full URL for the weblink. + * @type {string} + * @memberof Weblink + */ + url?: string; +} diff --git a/sync-for-expenses/src/sdk/pushoperations.ts b/sync-for-expenses/src/sdk/pushoperations.ts index deb3ed6ae..79a57a64d 100644 --- a/sync-for-expenses/src/sdk/pushoperations.ts +++ b/sync-for-expenses/src/sdk/pushoperations.ts @@ -1,46 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { pushOperationsGet } from "../funcs/pushOperationsGet.js"; -import { pushOperationsList } from "../funcs/pushOperationsList.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class PushOperations extends ClientSDK { - /** - * List push operations - * - * @remarks - * List push operation records. - */ - async list( - request: operations.ListPushOperationsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(pushOperationsList( - this, - request, - options, - )); - } - - /** - * Get push operation - * - * @remarks - * Retrieve push operation. - */ - async get( - request: operations.GetPushOperationRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(pushOperationsGet( - this, - request, - options, - )); - } -} +export { PushOperations } from "../apis/PushOperations"; diff --git a/sync-for-expenses/src/sdk/reimbursements.ts b/sync-for-expenses/src/sdk/reimbursements.ts index 0b805081c..81f6a2743 100644 --- a/sync-for-expenses/src/sdk/reimbursements.ts +++ b/sync-for-expenses/src/sdk/reimbursements.ts @@ -1,68 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { reimbursementsCreate } from "../funcs/reimbursementsCreate.js"; -import { reimbursementsUpdate } from "../funcs/reimbursementsUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Reimbursements extends ClientSDK { - /** - * Create reimbursable expense transaction - * - * @remarks - * Use the *Create reimbursable expense* endpoint to submit an employee expense claim in the accounting platform for a given company's connection. - * - * [Reimbursable expense requests](https://docs.codat.io/sync-for-expenses-api#/schemas/ReimbursableExpenseTransactionRequest) are reflected in the accounting software in the form of **Bills** against an employee (who exists as a supplier in the accounting platform). - * - * ### Supported Integrations - * | Integration | Supported | - * |-----------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Zoho Books | Yes | - * | Sage Intacct | Yes | - */ - async create( - request: operations.CreateReimbursableExpenseTransactionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(reimbursementsCreate( - this, - request, - options, - )); - } - - /** - * Update reimbursable expense transaction - * - * @remarks - * The *Update reimbursable expense* endpoint updates an existing employee expense claim in the accounting platform for a given company's connection. - * - * Updating an existing [reimbursable expense transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/UpdateReimbursableExpenseTransactionRequest) will update the existing **bill** against an employee (who exists as a supplier in the accounting software). - * - * ### Supported Integrations - * | Integration | Supported | - * |-----------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Oracle NetSuite | Yes | - * | Zoho Books | Yes | - */ - async update( - request: operations.UpdateReimbursableExpenseTransactionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(reimbursementsUpdate( - this, - request, - options, - )); - } -} +export { Reimbursements } from "../apis/Reimbursements"; diff --git a/sync-for-expenses/src/sdk/sdk.ts b/sync-for-expenses/src/sdk/sdk.ts index e63b02426..aac59d827 100644 --- a/sync-for-expenses/src/sdk/sdk.ts +++ b/sync-for-expenses/src/sdk/sdk.ts @@ -1,136 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { validateWebhook } from "../funcs/validateWebhook.js"; -import { ClientSDK } from "../lib/sdks.js"; -import { Accounts } from "./accounts.js"; -import { Adjustments } from "./adjustments.js"; -import { Attachments } from "./attachments.js"; -import { BankAccounts } from "./bankaccounts.js"; -import { Companies } from "./companies.js"; -import { CompanyInfo } from "./companyinfo.js"; -import { Configuration } from "./configuration.js"; -import { Connections } from "./connections.js"; -import { Customers } from "./customers.js"; -import { Expenses } from "./expenses.js"; -import { ManageData } from "./managedata.js"; -import { MappingOptions } from "./mappingoptions.js"; -import * as shared from "./models/shared/index.js"; -import { PushOperations } from "./pushoperations.js"; -import { Reimbursements } from "./reimbursements.js"; -import { Suppliers } from "./suppliers.js"; -import { Sync } from "./sync.js"; -import { TransactionStatus } from "./transactionstatus.js"; -import { Transfers } from "./transfers.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class CodatSyncExpenses extends ClientSDK { - private _companies?: Companies; - get companies(): Companies { - return (this._companies ??= new Companies(this._options)); - } - - private _connections?: Connections; - get connections(): Connections { - return (this._connections ??= new Connections(this._options)); - } - - private _companyInfo?: CompanyInfo; - get companyInfo(): CompanyInfo { - return (this._companyInfo ??= new CompanyInfo(this._options)); - } - - private _configuration?: Configuration; - get configuration(): Configuration { - return (this._configuration ??= new Configuration(this._options)); - } - - private _mappingOptions?: MappingOptions; - get mappingOptions(): MappingOptions { - return (this._mappingOptions ??= new MappingOptions(this._options)); - } - - private _sync?: Sync; - get sync(): Sync { - return (this._sync ??= new Sync(this._options)); - } - - private _transactionStatus?: TransactionStatus; - get transactionStatus(): TransactionStatus { - return (this._transactionStatus ??= new TransactionStatus(this._options)); - } - - private _expenses?: Expenses; - get expenses(): Expenses { - return (this._expenses ??= new Expenses(this._options)); - } - - private _transfers?: Transfers; - get transfers(): Transfers { - return (this._transfers ??= new Transfers(this._options)); - } - - private _adjustments?: Adjustments; - get adjustments(): Adjustments { - return (this._adjustments ??= new Adjustments(this._options)); - } - - private _reimbursements?: Reimbursements; - get reimbursements(): Reimbursements { - return (this._reimbursements ??= new Reimbursements(this._options)); - } - - private _attachments?: Attachments; - get attachments(): Attachments { - return (this._attachments ??= new Attachments(this._options)); - } - - private _manageData?: ManageData; - get manageData(): ManageData { - return (this._manageData ??= new ManageData(this._options)); - } - - private _pushOperations?: PushOperations; - get pushOperations(): PushOperations { - return (this._pushOperations ??= new PushOperations(this._options)); - } - - private _accounts?: Accounts; - get accounts(): Accounts { - return (this._accounts ??= new Accounts(this._options)); - } - - private _bankAccounts?: BankAccounts; - get bankAccounts(): BankAccounts { - return (this._bankAccounts ??= new BankAccounts(this._options)); - } - - private _customers?: Customers; - get customers(): Customers { - return (this._customers ??= new Customers(this._options)); - } - - private _suppliers?: Suppliers; - get suppliers(): Suppliers { - return (this._suppliers ??= new Suppliers(this._options)); - } - - async validateWebhook({ - request, - }: { - request: { - body: string; - headers: Record | Headers; - url: string; - method: string; - } | Request; - }): Promise< - shared.ExpensesSyncWebhook | undefined | shared.ClientRateLimitWebhook - > { - return unwrapAsync(validateWebhook( - this, - { request }, - )); - } -} +export * from "../sdk"; diff --git a/sync-for-expenses/src/sdk/suppliers.ts b/sync-for-expenses/src/sdk/suppliers.ts index f0e3efff3..0b038af81 100644 --- a/sync-for-expenses/src/sdk/suppliers.ts +++ b/sync-for-expenses/src/sdk/suppliers.ts @@ -1,149 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { suppliersCreate } from "../funcs/suppliersCreate.js"; -import { suppliersGet } from "../funcs/suppliersGet.js"; -import { suppliersList } from "../funcs/suppliersList.js"; -import { suppliersUpdate } from "../funcs/suppliersUpdate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Suppliers extends ClientSDK { - /** - * List suppliers - * - * @remarks - * The *List suppliers* endpoint returns a list of [suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | Oracle NetSuite | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ - async list( - request: operations.ListSuppliersRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersList( - this, - request, - options, - )); - } - - /** - * Get supplier - * - * @remarks - * The *Get supplier* endpoint returns a single supplier for a given supplierId. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * Before using this endpoint, you must have [retrieved data for the company](https://docs.codat.io/sync-for-expenses-api#/operations/refresh-all-data-types). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | Oracle NetSuite | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ - async get( - request: operations.GetSupplierRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersGet( - this, - request, - options, - )); - } - - /** - * Create supplier - * - * @remarks - * The *Create supplier* endpoint creates a new [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------------------|-----------| - * | Dynamics 365 Business Central | Yes | - * | FreeAgent | Yes | - * | Oracle NetSuite | Yes | - * | QuickBooks Desktop | Yes | - * | QuickBooks Online | Yes | - * | Sage Intacct | Yes | - * | Xero | Yes | - * | Zoho Books | Yes | - */ - async create( - request: operations.CreateSupplierRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersCreate( - this, - request, - options, - )); - } - - /** - * Update supplier - * - * @remarks - * The *Update supplier* endpoint updates an existing [supplier](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) for a given company's connection. - * - * [Suppliers](https://docs.codat.io/sync-for-expenses-api#/schemas/Supplier) are people or organizations that provide something, such as a product or service. - * - * **Integration-specific behavior** - * - * Required data may vary by integration. To see what data to post, first call [Get create/update supplier model](https://docs.codat.io/sync-for-expenses-api#/operations/get-create-update-suppliers-model). - * - * ### Supported Integrations - * - * | Integration | Supported | - * |-------------------|-----------| - * | FreeAgent | Yes | - * | QuickBooks Online | Yes | - * | Xero | Yes | - */ - async update( - request: operations.UpdateSupplierRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(suppliersUpdate( - this, - request, - options, - )); - } -} +export { Suppliers } from "../apis/Suppliers"; diff --git a/sync-for-expenses/src/sdk/sync.ts b/sync-for-expenses/src/sdk/sync.ts index c40062f86..fa6d96963 100644 --- a/sync-for-expenses/src/sdk/sync.ts +++ b/sync-for-expenses/src/sdk/sync.ts @@ -1,82 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { syncGet } from "../funcs/syncGet.js"; -import { syncGetLastSuccessfulSync } from "../funcs/syncGetLastSuccessfulSync.js"; -import { syncGetLatestSync } from "../funcs/syncGetLatestSync.js"; -import { syncList } from "../funcs/syncList.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Sync extends ClientSDK { - /** - * Last successful sync - * - * @remarks - * Gets the status of the last successful sync - */ - async getLastSuccessfulSync( - request: operations.GetLastSuccessfulSyncRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(syncGetLastSuccessfulSync( - this, - request, - options, - )); - } - - /** - * Latest sync status - * - * @remarks - * Gets the latest sync status - */ - async getLatestSync( - request: operations.GetLatestSyncRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(syncGetLatestSync( - this, - request, - options, - )); - } - - /** - * List sync statuses - * - * @remarks - * Gets a list of sync statuses - */ - async list( - request: operations.ListSyncsRequest, - options?: RequestOptions, - ): Promise> { - return unwrapAsync(syncList( - this, - request, - options, - )); - } - - /** - * Get sync status - * - * @remarks - * Get the sync status for a specified sync - */ - async get( - request: operations.GetSyncByIdRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(syncGet( - this, - request, - options, - )); - } -} +export { Sync } from "../apis/Sync"; diff --git a/sync-for-expenses/src/sdk/transactionstatus.ts b/sync-for-expenses/src/sdk/transactionstatus.ts index 14229325a..cb34fca5b 100644 --- a/sync-for-expenses/src/sdk/transactionstatus.ts +++ b/sync-for-expenses/src/sdk/transactionstatus.ts @@ -1,46 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { transactionStatusGet } from "../funcs/transactionStatusGet.js"; -import { transactionStatusList } from "../funcs/transactionStatusList.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class TransactionStatus extends ClientSDK { - /** - * List sync transactions - * - * @remarks - * Gets the transactions and status for a sync - */ - async list( - request: operations.ListSyncTransactionsRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(transactionStatusList( - this, - request, - options, - )); - } - - /** - * Get sync transaction - * - * @remarks - * Gets the status of a transaction for a sync - */ - async get( - request: operations.GetSyncTransactionRequest, - options?: RequestOptions, - ): Promise> { - return unwrapAsync(transactionStatusGet( - this, - request, - options, - )); - } -} +export { TransactionStatus } from "../apis/TransactionStatus"; diff --git a/sync-for-expenses/src/sdk/transfers.ts b/sync-for-expenses/src/sdk/transfers.ts index d225138ea..7be43f7a6 100644 --- a/sync-for-expenses/src/sdk/transfers.ts +++ b/sync-for-expenses/src/sdk/transfers.ts @@ -1,44 +1 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import { transfersCreate } from "../funcs/transfersCreate.js"; -import { ClientSDK, RequestOptions } from "../lib/sdks.js"; -import * as operations from "./models/operations/index.js"; -import * as shared from "./models/shared/index.js"; -import { unwrapAsync } from "./types/fp.js"; - -export class Transfers extends ClientSDK { - /** - * Create transfer transaction - * - * @remarks - * Use the *Create transfer* endpoint to create or update a [transfer transaction](https://docs.codat.io/sync-for-expenses-api#/schemas/TransferTransactionRequest) in the accounting software for a given company's connection. - * - * Transfers record the movement of money between two bank accounts, or between a bank account and a nominal account. Use them to represent actions such as topping up a debit card account or a balance transfer to another credit card. - * - * The `from.amount` and `to.amount` fields are in the native currency of the account. - * - * ### Supported Integrations - * | Integration | Create transfer | Update transfer | - * |-----------------------|------------------|------------------| - * | Dynamics | No | No | - * | FreeAgent | Yes | Yes | - * | NetSuite | No | No | - * | QuickBooks Desktop | Yes | No | - * | QuickBooks Online | Yes | Yes | - * | Sage Intacct | No | No | - * | Xero | Yes | No | - * | Zoho Books | No | No | - */ - async create( - request: operations.CreateTransferTransactionRequest, - options?: RequestOptions, - ): Promise { - return unwrapAsync(transfersCreate( - this, - request, - options, - )); - } -} +export { Transfers } from "../apis/Transfers"; diff --git a/sync-for-expenses/src/sdk/types/async.ts b/sync-for-expenses/src/sdk/types/async.ts index 689dba5de..208661e87 100644 --- a/sync-for-expenses/src/sdk/types/async.ts +++ b/sync-for-expenses/src/sdk/types/async.ts @@ -1,68 +1,51 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ export type APICall = - | { - status: "complete"; - request: Request; - response: Response; - } - | { - status: "request-error"; - request: Request; - response?: undefined; - } - | { - status: "invalid"; - request?: undefined; - response?: undefined; - }; + | { status: "complete"; request: Request; response: Response } + | { status: "request-error"; request: Request; response?: undefined } + | { status: "invalid"; request?: undefined; response?: undefined }; -export class APIPromise implements Promise { - readonly #promise: Promise<[T, APICall]>; - readonly #unwrapped: Promise; +export class APIPromise { + private readonly inner: Promise; - readonly [Symbol.toStringTag] = "APIPromise"; + constructor(inner: Promise) { + this.inner = inner; + } - constructor(p: [T, APICall] | Promise<[T, APICall]>) { - this.#promise = p instanceof Promise ? p : Promise.resolve(p); - this.#unwrapped = - p instanceof Promise - ? this.#promise.then(([value]) => value) - : Promise.resolve(p[0]); - } + then( + onfulfilled?: ((value: T) => R1 | PromiseLike) | null, + onrejected?: ((reason: unknown) => R2 | PromiseLike) | null, + ): Promise { + return this.inner.then(onfulfilled, onrejected); + } - then( - onfulfilled?: - | ((value: T) => TResult1 | PromiseLike) - | null - | undefined, - onrejected?: - | ((reason: any) => TResult2 | PromiseLike) - | null - | undefined, - ): Promise { - return this.#promise.then( - onfulfilled ? ([value]) => onfulfilled(value) : void 0, - onrejected, - ); - } + catch(onrejected?: ((reason: unknown) => R | PromiseLike) | null): Promise { + return this.inner.catch(onrejected); + } - catch( - onrejected?: - | ((reason: any) => TResult | PromiseLike) - | null - | undefined, - ): Promise { - return this.#unwrapped.catch(onrejected); - } + finally(onfinally?: (() => void) | null): Promise { + return this.inner.then( + (value) => { + if (onfinally) { + onfinally(); + } + return value; + }, + (reason) => { + if (onfinally) { + onfinally(); + } + throw reason; + }, + ); + } - finally(onfinally?: (() => void) | null | undefined): Promise { - return this.#unwrapped.finally(onfinally); - } + $inspect(): Promise { + return this.inner; + } - $inspect(): Promise<[T, APICall]> { - return this.#promise; - } + get [Symbol.toStringTag](): string { + return "APIPromise"; + } } diff --git a/sync-for-expenses/src/sdk/types/blobs.ts b/sync-for-expenses/src/sdk/types/blobs.ts deleted file mode 100644 index cce2892d4..000000000 --- a/sync-for-expenses/src/sdk/types/blobs.ts +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export const blobLikeSchema: z.ZodType = z.custom< - Blob ->(isBlobLike, { - message: "expected a Blob, File or Blob-like object", - fatal: true, -}); - -export function isBlobLike(val: unknown): val is Blob { - if (val instanceof Blob) { - return true; - } - - if (typeof val !== "object" || val == null || !(Symbol.toStringTag in val)) { - return false; - } - - const name = val[Symbol.toStringTag]; - if (typeof name !== "string") { - return false; - } - if (name !== "Blob" && name !== "File") { - return false; - } - - return "stream" in val && typeof val.stream === "function"; -} diff --git a/sync-for-expenses/src/sdk/types/constdatetime.ts b/sync-for-expenses/src/sdk/types/constdatetime.ts deleted file mode 100644 index fe62144ea..000000000 --- a/sync-for-expenses/src/sdk/types/constdatetime.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; - -export function constDateTime( - val: string, -): z.ZodType { - return z.custom((v) => { - return ( - typeof v === "string" && new Date(v).getTime() === new Date(val).getTime() - ); - }, `Value must be equivalent to ${val}`); -} diff --git a/sync-for-expenses/src/sdk/types/decimal.ts b/sync-for-expenses/src/sdk/types/decimal.ts index a7895d555..5dcba30f5 100644 --- a/sync-for-expenses/src/sdk/types/decimal.ts +++ b/sync-for-expenses/src/sdk/types/decimal.ts @@ -1,5 +1,3 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - +/* tslint:disable */ +/* eslint-disable */ export * from "decimal.js"; diff --git a/sync-for-expenses/src/sdk/types/enums.ts b/sync-for-expenses/src/sdk/types/enums.ts deleted file mode 100644 index aba0ffd2a..000000000 --- a/sync-for-expenses/src/sdk/types/enums.ts +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -import * as z from "zod/v3"; -import { Unrecognized, unrecognized } from "./unrecognized.js"; - -export type ClosedEnum>> = - T[keyof T]; -export type OpenEnum>> = - | T[keyof T] - | Unrecognized; - -export function inboundSchema>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - const options = Object.values(enumObj); - return z.union([ - ...options.map(x => z.literal(x)), - z.string().transform(x => unrecognized(x)), - ] as any); -} - -export function inboundSchemaInt>( - enumObj: T, -): z.ZodType, z.ZodTypeDef, unknown> { - // For numeric enums, Object.values returns both numbers and string keys - const options = Object.values(enumObj).filter(v => typeof v === "number"); - return z.union([ - ...options.map(x => z.literal(x)), - z.number().int().transform(x => unrecognized(x)), - ] as any); -} - -export function outboundSchema>( - _: T, -): z.ZodType> { - return z.string() as any; -} - -export function outboundSchemaInt>( - _: T, -): z.ZodType> { - return z.number().int() as any; -} diff --git a/sync-for-expenses/src/sdk/types/fp.ts b/sync-for-expenses/src/sdk/types/fp.ts index ccbe51eac..84eb7e4f3 100644 --- a/sync-for-expenses/src/sdk/types/fp.ts +++ b/sync-for-expenses/src/sdk/types/fp.ts @@ -1,50 +1,25 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -/** - * A monad that captures the result of a function call or an error if it was not - * successful. Railway programming, enabled by this type, can be a nicer - * alternative to traditional exception throwing because it allows functions to - * declare all _known_ errors with static types and then check for them - * exhaustively in application code. Thrown exception have a type of `unknown` - * and break out of regular control flow of programs making them harder to - * inspect and more verbose work with due to try-catch blocks. - */ -export type Result = - | { ok: true; value: T; error?: never } - | { ok: false; value?: never; error: E }; +export type Result = + | { ok: true; value: T; error?: never } + | { ok: false; value?: never; error: E }; -export function OK(value: V): Result { - return { ok: true, value }; +export function OK(value: T): Result { + return { ok: true, value }; } export function ERR(error: E): Result { - return { ok: false, error }; + return { ok: false, error }; } -/** - * unwrap is a convenience function for extracting a value from a result or - * throwing if there was an error. - */ export function unwrap(r: Result): T { - if (!r.ok) { + if (r.ok) { + return r.value; + } throw r.error; - } - return r.value; } -/** - * unwrapAsync is a convenience function for resolving a value from a Promise - * of a result or rejecting if an error occurred. - */ -export async function unwrapAsync( - pr: Promise>, -): Promise { - const r = await pr; - if (!r.ok) { - throw r.error; - } - - return r.value; +export async function unwrapAsync(pr: Promise>): Promise { + return unwrap(await pr); } diff --git a/sync-for-expenses/src/sdk/types/index.ts b/sync-for-expenses/src/sdk/types/index.ts index 19a7bd013..43093a397 100644 --- a/sync-for-expenses/src/sdk/types/index.ts +++ b/sync-for-expenses/src/sdk/types/index.ts @@ -1,13 +1,8 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ -export { blobLikeSchema, isBlobLike } from "./blobs.js"; -export { Decimal } from "./decimal.js"; -export type { ClosedEnum, OpenEnum } from "./enums.js"; -export type { Result } from "./fp.js"; -export type { PageIterator, Paginator } from "./operations.js"; -export { createPageIterator } from "./operations.js"; -export { RFCDate } from "./rfcdate.js"; -export * from "./unrecognized.js"; -export type { WebhookRecipient } from "./webhooks.js"; +export * from './rfcdate'; +export * from './async'; +export * from './decimal'; +export * from './fp'; +export * from './operations'; diff --git a/sync-for-expenses/src/sdk/types/operations.ts b/sync-for-expenses/src/sdk/types/operations.ts index beb81e10f..b6d42c45c 100644 --- a/sync-for-expenses/src/sdk/types/operations.ts +++ b/sync-for-expenses/src/sdk/types/operations.ts @@ -1,6 +1,5 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ +/* tslint:disable */ +/* eslint-disable */ import { Result } from "./fp.js"; @@ -101,5 +100,3 @@ function unwrapPaginator( }); }; } - -export const URL_OVERRIDE = Symbol("URL_OVERRIDE"); diff --git a/sync-for-expenses/src/sdk/types/rfcdate.ts b/sync-for-expenses/src/sdk/types/rfcdate.ts index c79b3f53a..03939e51e 100644 --- a/sync-for-expenses/src/sdk/types/rfcdate.ts +++ b/sync-for-expenses/src/sdk/types/rfcdate.ts @@ -1,54 +1,22 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -const dateRE = /^\d{4}-\d{2}-\d{2}$/; +/* tslint:disable */ +/* eslint-disable */ export class RFCDate { - private serialized: string; - - /** - * Creates a new RFCDate instance using today's date. - */ - static today(): RFCDate { - return new RFCDate(new Date()); - } + private date: string; - /** - * Creates a new RFCDate instance using the provided input. - * If a string is used then in must be in the format YYYY-MM-DD. - * - * @param date A Date object or a date string in YYYY-MM-DD format - * @example - * new RFCDate("2022-01-01") - * @example - * new RFCDate(new Date()) - */ - constructor(date: Date | string) { - if (typeof date === "string" && !dateRE.test(date)) { - throw new RangeError( - "RFCDate: date strings must be in the format YYYY-MM-DD: " + date, - ); + constructor(date: Date | string) { + this.date = date instanceof Date ? date.toISOString().slice(0, 10) : date; } - const value = new Date(date); - if (isNaN(+value)) { - throw new RangeError("RFCDate: invalid date provided: " + date); + static today(): RFCDate { + return new RFCDate(new Date()); } - this.serialized = value.toISOString().slice(0, "YYYY-MM-DD".length); - if (!dateRE.test(this.serialized)) { - throw new TypeError( - `RFCDate: failed to build valid date with given value: ${date} serialized to ${this.serialized}`, - ); + toJSON(): string { + return this.date; } - } - toJSON(): string { - return this.toString(); - } - - toString(): string { - return this.serialized; - } + toString(): string { + return this.date; + } } diff --git a/sync-for-expenses/src/sdk/types/streams.ts b/sync-for-expenses/src/sdk/types/streams.ts deleted file mode 100644 index a0163e7a9..000000000 --- a/sync-for-expenses/src/sdk/types/streams.ts +++ /dev/null @@ -1,21 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export function isReadableStream( - val: unknown, -): val is ReadableStream { - if (typeof val !== "object" || val === null) { - return false; - } - - // Check for the presence of methods specific to ReadableStream - const stream = val as ReadableStream; - - // ReadableStream has methods like getReader, cancel, and tee - return ( - typeof stream.getReader === "function" && - typeof stream.cancel === "function" && - typeof stream.tee === "function" - ); -} diff --git a/sync-for-expenses/src/sdk/types/unrecognized.ts b/sync-for-expenses/src/sdk/types/unrecognized.ts deleted file mode 100644 index b7a2a13f3..000000000 --- a/sync-for-expenses/src/sdk/types/unrecognized.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -declare const __brand: unique symbol; -export type Unrecognized = T & { [__brand]: "unrecognized" }; - -function unrecognized(value: T): Unrecognized { - globalCount++; - return value as Unrecognized; -} - -let globalCount = 0; -let refCount = 0; -export function startCountingUnrecognized() { - refCount++; - const start = globalCount; - return { - /** - * Ends counting and returns the delta. - * @param delta - If provided, only this amount is added to the parent counter - * (used for nested unions where we only want to record the winning option's count). - * If not provided, records all counts since start(). - */ - end: (delta?: number) => { - const count = globalCount - start; - // Reset globalCount back to start, then add only the specified delta - globalCount = start + (delta ?? count); - if (--refCount === 0) globalCount = 0; - return count; - }, - }; -} - -export { unrecognized }; diff --git a/sync-for-expenses/src/sdk/types/webhooks.ts b/sync-for-expenses/src/sdk/types/webhooks.ts deleted file mode 100644 index 9510d20c0..000000000 --- a/sync-for-expenses/src/sdk/types/webhooks.ts +++ /dev/null @@ -1,7 +0,0 @@ -/* - * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. - */ - -export type WebhookRecipient = { - url: string; -}; diff --git a/sync-for-expenses/tsconfig.esm.json b/sync-for-expenses/tsconfig.esm.json new file mode 100644 index 000000000..b98a6d38d --- /dev/null +++ b/sync-for-expenses/tsconfig.esm.json @@ -0,0 +1,8 @@ +{ + "include": ["src"], + "extends": "./tsconfig.json", + "compilerOptions": { + "module": "esnext", + "outDir": "dist/esm" + } +} diff --git a/sync-for-expenses/tsconfig.json b/sync-for-expenses/tsconfig.json index 76110f883..ffd54239f 100644 --- a/sync-for-expenses/tsconfig.json +++ b/sync-for-expenses/tsconfig.json @@ -1,41 +1,17 @@ { + "include": ["src"], "compilerOptions": { - "incremental": false, - "target": "ES2020", - "lib": ["ES2022", "DOM", "DOM.Iterable"], - "jsx": "react-jsx", - - "module": "Node16", - "moduleResolution": "Node16", - - "allowJs": true, - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "rootDir": "src", - "outDir": ".", - - - // https://github.com/tsconfig/bases/blob/a1bf7c0fa2e094b068ca3e1448ca2ece4157977e/bases/strictest.json - "strict": true, - "allowUnusedLabels": false, - "allowUnreachableCode": false, - "exactOptionalPropertyTypes": true, - "useUnknownInCatchVariables": true, - "noFallthroughCasesInSwitch": true, - "noImplicitOverride": true, - "noImplicitReturns": true, - "noPropertyAccessFromIndexSignature": true, - "noUncheckedIndexedAccess": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "isolatedModules": true, - "checkJs": true, - "esModuleInterop": true, - "skipLibCheck": true, - "forceConsistentCasingInFileNames": true + "target": "es2018", + "module": "commonjs", + "moduleResolution": "node", + "outDir": "dist", + "typeRoots": [ + "node_modules/@types" + ] }, - "include": ["src"], - "exclude": ["node_modules", "src/__tests__"] + "exclude": [ + "dist", + "node_modules" + ] }