@codat/lending 4.2.0 → 4.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/README.md +36 -1
  2. package/dist/sdk/companies.d.ts +22 -7
  3. package/dist/sdk/companies.js +22 -7
  4. package/dist/sdk/models/operations/getcreateoperation.d.ts +1 -1
  5. package/dist/sdk/models/shared/accountingbillcreditnote.d.ts +2 -2
  6. package/dist/sdk/models/shared/accountingbillcreditnote.js +3 -3
  7. package/dist/sdk/models/shared/accountingcreateaccountresponse.d.ts +171 -34
  8. package/dist/sdk/models/shared/accountingcreateaccountresponse.js +194 -4
  9. package/dist/sdk/models/shared/accountingcreatebankaccountresponse.d.ts +116 -22
  10. package/dist/sdk/models/shared/accountingcreatebankaccountresponse.js +118 -4
  11. package/dist/sdk/models/shared/accountingcreatebanktransactionsresponse.d.ts +12 -2
  12. package/dist/sdk/models/shared/accountingcreatebanktransactionsresponse.js +26 -4
  13. package/dist/sdk/models/shared/accountingcreatedirectcostresponse.d.ts +165 -18
  14. package/dist/sdk/models/shared/accountingcreatedirectcostresponse.js +150 -4
  15. package/dist/sdk/models/shared/accountingcreatepaymentresponse.d.ts +797 -675
  16. package/dist/sdk/models/shared/accountingcreatepaymentresponse.js +782 -4
  17. package/dist/sdk/models/shared/accountingcreatesupplierresponse.d.ts +69 -11
  18. package/dist/sdk/models/shared/accountingcreatesupplierresponse.js +99 -4
  19. package/dist/sdk/models/shared/accountingcreatetransferresponse.d.ts +81 -9
  20. package/dist/sdk/models/shared/accountingcreatetransferresponse.js +93 -4
  21. package/dist/sdk/models/shared/accountingcreditnote.d.ts +2 -2
  22. package/dist/sdk/models/shared/accountingcreditnote.js +3 -3
  23. package/dist/sdk/models/shared/accountingdirectcost.d.ts +11 -5
  24. package/dist/sdk/models/shared/accountingdirectcost.js +18 -11
  25. package/dist/sdk/models/shared/accountinginvoice.d.ts +10 -5
  26. package/dist/sdk/models/shared/accountinginvoice.js +11 -5
  27. package/dist/sdk/models/shared/accountingjournalentry.d.ts +3 -7
  28. package/dist/sdk/models/shared/accountingjournalentry.js +3 -3
  29. package/dist/sdk/models/shared/accounttransactionline.d.ts +3 -7
  30. package/dist/sdk/models/shared/accounttransactionline.js +3 -3
  31. package/dist/sdk/models/shared/accounttransactionlinerecordref.d.ts +30 -0
  32. package/dist/sdk/models/shared/accounttransactionlinerecordref.js +70 -0
  33. package/dist/sdk/models/shared/bankingtransactioncategory.d.ts +5 -1
  34. package/dist/sdk/models/shared/bankingtransactioncategory.js +5 -1
  35. package/dist/sdk/models/shared/company.d.ts +10 -0
  36. package/dist/sdk/models/shared/company.js +20 -1
  37. package/dist/sdk/models/shared/companyrequestbody.d.ts +5 -0
  38. package/dist/sdk/models/shared/companyrequestbody.js +7 -0
  39. package/dist/sdk/models/shared/connection.d.ts +2 -0
  40. package/dist/sdk/models/shared/connection.js +2 -0
  41. package/dist/sdk/models/shared/contactref.d.ts +9 -3
  42. package/dist/sdk/models/shared/contactref.js +9 -2
  43. package/dist/sdk/models/shared/directcostprototype.d.ts +11 -5
  44. package/dist/sdk/models/shared/directcostprototype.js +18 -11
  45. package/dist/sdk/models/shared/errormessage.d.ts +5 -0
  46. package/dist/sdk/models/shared/errormessage.js +7 -0
  47. package/dist/sdk/models/shared/errorvalidation.d.ts +9 -0
  48. package/dist/sdk/models/shared/errorvalidation.js +56 -0
  49. package/dist/sdk/models/shared/errorvalidationitem.d.ts +15 -0
  50. package/dist/sdk/models/shared/errorvalidationitem.js +55 -0
  51. package/dist/sdk/models/shared/index.d.ts +6 -0
  52. package/dist/sdk/models/shared/index.js +6 -0
  53. package/dist/sdk/models/shared/invoicelineitem.d.ts +0 -2
  54. package/dist/sdk/models/shared/items.d.ts +2 -6
  55. package/dist/sdk/models/shared/items.js +2 -7
  56. package/dist/sdk/models/shared/journalentryrecordref.d.ts +30 -0
  57. package/dist/sdk/models/shared/journalentryrecordref.js +70 -0
  58. package/dist/sdk/models/shared/journalline.d.ts +2 -2
  59. package/dist/sdk/models/shared/journalline.js +3 -3
  60. package/dist/sdk/models/shared/tracking.d.ts +2 -1
  61. package/dist/sdk/models/shared/tracking.js +3 -2
  62. package/dist/sdk/models/shared/trackingrecordref.d.ts +22 -0
  63. package/dist/sdk/models/shared/trackingrecordref.js +62 -0
  64. package/dist/sdk/models/shared/withholdingtaxitems.d.ts +11 -0
  65. package/dist/sdk/models/shared/withholdingtaxitems.js +50 -0
  66. package/dist/sdk/sdk.js +3 -3
  67. package/docs/sdk/models/operations/createcompanyresponse.md +7 -7
  68. package/docs/sdk/models/operations/createconnectionresponse.md +7 -7
  69. package/docs/sdk/models/operations/createsupplierrequest.md +7 -7
  70. package/docs/sdk/models/operations/getaccountingagedcreditorsreportresponse.md +7 -7
  71. package/docs/sdk/models/operations/getaccountingageddebtorsreportresponse.md +7 -7
  72. package/docs/sdk/models/operations/getaccountingbillcreditnoteresponse.md +7 -7
  73. package/docs/sdk/models/operations/getaccountingbillpaymentresponse.md +7 -7
  74. package/docs/sdk/models/operations/getaccountingcreditnoteresponse.md +7 -7
  75. package/docs/sdk/models/operations/getaccountingprofileresponse.md +7 -7
  76. package/docs/sdk/models/operations/getaccountingsupplierresponse.md +7 -7
  77. package/docs/sdk/models/operations/getbankingaccountresponse.md +7 -7
  78. package/docs/sdk/models/operations/getbankingtransactioncategoryresponse.md +7 -7
  79. package/docs/sdk/models/operations/getbankingtransactionresponse.md +7 -7
  80. package/docs/sdk/models/operations/getcategorizedbalancesheetstatementresponse.md +7 -7
  81. package/docs/sdk/models/operations/getcategorizedprofitandlossstatementresponse.md +7 -7
  82. package/docs/sdk/models/operations/getcommercecustomerresponse.md +7 -7
  83. package/docs/sdk/models/operations/getcommercedisputeresponse.md +7 -7
  84. package/docs/sdk/models/operations/getcommercelocationresponse.md +7 -7
  85. package/docs/sdk/models/operations/getcommerceorderresponse.md +7 -7
  86. package/docs/sdk/models/operations/getcommerceproductcategoryresponse.md +7 -7
  87. package/docs/sdk/models/operations/getcompanyresponse.md +7 -7
  88. package/docs/sdk/models/operations/getconnectionresponse.md +7 -7
  89. package/docs/sdk/models/operations/getcreateoperationrequest.md +4 -4
  90. package/docs/sdk/models/operations/getloansummaryresponse.md +7 -7
  91. package/docs/sdk/models/operations/getpulloperationresponse.md +7 -7
  92. package/docs/sdk/models/operations/listaccountingaccountsresponse.md +7 -7
  93. package/docs/sdk/models/operations/listaccountingaccounttransactionsresponse.md +7 -7
  94. package/docs/sdk/models/operations/listaccountingbankaccountsresponse.md +7 -7
  95. package/docs/sdk/models/operations/listaccountingbankaccounttransactionsresponse.md +7 -7
  96. package/docs/sdk/models/operations/listaccountingbillcreditnotesresponse.md +7 -7
  97. package/docs/sdk/models/operations/listaccountingbillpaymentsresponse.md +7 -7
  98. package/docs/sdk/models/operations/listaccountingbillsresponse.md +7 -7
  99. package/docs/sdk/models/operations/listaccountingcreditnotesresponse.md +7 -7
  100. package/docs/sdk/models/operations/listaccountingcustomersresponse.md +7 -7
  101. package/docs/sdk/models/operations/listaccountingdirectcostsresponse.md +7 -7
  102. package/docs/sdk/models/operations/listaccountingdirectincomesresponse.md +7 -7
  103. package/docs/sdk/models/operations/listaccountinginvoicesresponse.md +7 -7
  104. package/docs/sdk/models/operations/listaccountingjournalentriesresponse.md +7 -7
  105. package/docs/sdk/models/operations/listaccountingjournalsresponse.md +7 -7
  106. package/docs/sdk/models/operations/listaccountingpaymentsresponse.md +7 -7
  107. package/docs/sdk/models/operations/listaccountingsuppliersresponse.md +7 -7
  108. package/docs/sdk/models/operations/listaccountingtransfersresponse.md +7 -7
  109. package/docs/sdk/models/operations/listbankingaccountbalancesresponse.md +7 -7
  110. package/docs/sdk/models/operations/listbankingaccountsresponse.md +7 -7
  111. package/docs/sdk/models/operations/listbankingtransactioncategoriesresponse.md +7 -7
  112. package/docs/sdk/models/operations/listbankingtransactionsresponse.md +7 -7
  113. package/docs/sdk/models/operations/listcommercecustomersresponse.md +7 -7
  114. package/docs/sdk/models/operations/listcommercedisputesresponse.md +7 -7
  115. package/docs/sdk/models/operations/listcommercelocationsresponse.md +7 -7
  116. package/docs/sdk/models/operations/listcommerceordersresponse.md +7 -7
  117. package/docs/sdk/models/operations/listcommercepaymentmethodsresponse.md +7 -7
  118. package/docs/sdk/models/operations/listcommercepaymentsresponse.md +7 -7
  119. package/docs/sdk/models/operations/listcommerceproductcategoriesresponse.md +7 -7
  120. package/docs/sdk/models/operations/listcommerceproductsresponse.md +7 -7
  121. package/docs/sdk/models/operations/listcommercetransactionsresponse.md +7 -7
  122. package/docs/sdk/models/operations/listcompaniesresponse.md +7 -7
  123. package/docs/sdk/models/operations/listconnectionsresponse.md +7 -7
  124. package/docs/sdk/models/operations/listcreateoperationsresponse.md +7 -7
  125. package/docs/sdk/models/operations/listdataintegritydetailsresponse.md +7 -7
  126. package/docs/sdk/models/operations/listloantransactionsresponse.md +7 -7
  127. package/docs/sdk/models/operations/listpulloperationsresponse.md +7 -7
  128. package/docs/sdk/models/operations/refreshdatatyperesponse.md +7 -7
  129. package/docs/sdk/models/operations/unlinkconnectionresponse.md +7 -7
  130. package/docs/sdk/models/operations/updatecompanyresponse.md +7 -7
  131. package/docs/sdk/models/shared/accountingaccounts.md +7 -7
  132. package/docs/sdk/models/shared/accountingaccounttransactions.md +7 -7
  133. package/docs/sdk/models/shared/accountingbankaccounts.md +7 -7
  134. package/docs/sdk/models/shared/accountingbanktransactions.md +7 -7
  135. package/docs/sdk/models/shared/accountingbillcreditnote.md +1 -1
  136. package/docs/sdk/models/shared/accountingbillcreditnotes.md +7 -7
  137. package/docs/sdk/models/shared/accountingbillpayment.md +1 -1
  138. package/docs/sdk/models/shared/accountingbillpayments.md +7 -7
  139. package/docs/sdk/models/shared/accountingbills.md +7 -7
  140. package/docs/sdk/models/shared/accountingcreateaccountresponse.md +16 -16
  141. package/docs/sdk/models/shared/accountingcreateaccountresponseaccountingaccount.md +54 -0
  142. package/docs/sdk/models/shared/accountingcreateaccountresponsevaliddatatypelinks.md +50 -0
  143. package/docs/sdk/models/shared/accountingcreatebankaccountresponse.md +16 -16
  144. package/docs/sdk/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md +42 -0
  145. package/docs/sdk/models/shared/accountingcreatebankaccounttransactions.md +11 -0
  146. package/docs/sdk/models/shared/accountingcreatebanktransactionsresponse.md +1 -1
  147. package/docs/sdk/models/shared/accountingcreatedirectcostresponse.md +16 -16
  148. package/docs/sdk/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md +41 -0
  149. package/docs/sdk/models/shared/accountingcreatedirectcostresponsecontactreference.md +11 -0
  150. package/docs/sdk/models/shared/accountingcreatedirectcostresponsedatatype.md +11 -0
  151. package/docs/sdk/models/shared/accountingcreatepaymentresponse.md +16 -16
  152. package/docs/sdk/models/shared/accountingcreatepaymentresponseaccountingpayment.md +703 -0
  153. package/docs/sdk/models/shared/accountingcreatesupplierresponse.md +1 -1
  154. package/docs/sdk/models/shared/accountingcreatesupplierresponseaccountingsupplier.md +29 -0
  155. package/docs/sdk/models/shared/accountingcreatetransferresponse.md +1 -1
  156. package/docs/sdk/models/shared/accountingcreatetransferresponseaccountingtransfer.md +25 -0
  157. package/docs/sdk/models/shared/accountingcreditnote.md +1 -1
  158. package/docs/sdk/models/shared/accountingcreditnotes.md +7 -7
  159. package/docs/sdk/models/shared/accountingcustomers.md +7 -7
  160. package/docs/sdk/models/shared/accountingdirectcost.md +1 -1
  161. package/docs/sdk/models/shared/accountingdirectcostcontactreference.md +11 -0
  162. package/docs/sdk/models/shared/accountingdirectcostdatatype.md +11 -0
  163. package/docs/sdk/models/shared/accountingdirectcosts.md +7 -7
  164. package/docs/sdk/models/shared/accountingdirectincomes.md +7 -7
  165. package/docs/sdk/models/shared/accountinginvoice.md +1 -1
  166. package/docs/sdk/models/shared/accountinginvoicedatatype.md +10 -0
  167. package/docs/sdk/models/shared/accountinginvoices.md +7 -7
  168. package/docs/sdk/models/shared/accountingjournalentries.md +7 -7
  169. package/docs/sdk/models/shared/accountingjournalentry.md +1 -1
  170. package/docs/sdk/models/shared/accountingjournals.md +7 -7
  171. package/docs/sdk/models/shared/accountingpayment.md +1 -1
  172. package/docs/sdk/models/shared/accountingpayments.md +7 -7
  173. package/docs/sdk/models/shared/accountingsuppliers.md +7 -7
  174. package/docs/sdk/models/shared/accountingtransfers.md +7 -7
  175. package/docs/sdk/models/shared/accounts.md +1 -1
  176. package/docs/sdk/models/shared/accounttransactionline.md +5 -5
  177. package/docs/sdk/models/shared/accounttransactionlinerecordref.md +11 -0
  178. package/docs/sdk/models/shared/accounttransactionlinerecordrefdatatype.md +20 -0
  179. package/docs/sdk/models/shared/bankingaccountbalances.md +7 -7
  180. package/docs/sdk/models/shared/bankingaccounts.md +7 -7
  181. package/docs/sdk/models/shared/bankingtransactioncategories.md +7 -7
  182. package/docs/sdk/models/shared/bankingtransactioncategory.md +3 -1
  183. package/docs/sdk/models/shared/bankingtransactions.md +7 -7
  184. package/docs/sdk/models/shared/commercecustomers.md +7 -7
  185. package/docs/sdk/models/shared/commercedisputes.md +7 -7
  186. package/docs/sdk/models/shared/commercelocations.md +7 -7
  187. package/docs/sdk/models/shared/commerceorders.md +7 -7
  188. package/docs/sdk/models/shared/commercepayment.md +1 -1
  189. package/docs/sdk/models/shared/commercepaymentmethods.md +7 -7
  190. package/docs/sdk/models/shared/commercepayments.md +7 -7
  191. package/docs/sdk/models/shared/commerceproductcategories.md +7 -7
  192. package/docs/sdk/models/shared/commerceproducts.md +7 -7
  193. package/docs/sdk/models/shared/commercetransactions.md +7 -7
  194. package/docs/sdk/models/shared/companies.md +7 -7
  195. package/docs/sdk/models/shared/company.md +1 -0
  196. package/docs/sdk/models/shared/companyrequestbody.md +1 -0
  197. package/docs/sdk/models/shared/connections.md +7 -7
  198. package/docs/sdk/models/shared/contactref.md +4 -4
  199. package/docs/sdk/models/shared/contactrefdatatype.md +11 -0
  200. package/docs/sdk/models/shared/contactreference.md +11 -0
  201. package/docs/sdk/models/shared/dataintegritydetails.md +7 -7
  202. package/docs/sdk/models/shared/directcostprototype.md +1 -1
  203. package/docs/sdk/models/shared/directcostprototypedatatype.md +11 -0
  204. package/docs/sdk/models/shared/enhancedcashflowtransaction.md +2 -2
  205. package/docs/sdk/models/shared/enhancedcashflowtransactions.md +5 -5
  206. package/docs/sdk/models/shared/enhancedinvoicesreport.md +4 -4
  207. package/docs/sdk/models/shared/errormessage.md +9 -8
  208. package/docs/sdk/models/shared/errorvalidation.md +11 -0
  209. package/docs/sdk/models/shared/errorvalidationitem.md +10 -0
  210. package/docs/sdk/models/shared/groupreference.md +8 -0
  211. package/docs/sdk/models/shared/invoicelineitem.md +1 -1
  212. package/docs/sdk/models/shared/items.md +3 -4
  213. package/docs/sdk/models/shared/journalentryrecordref.md +11 -0
  214. package/docs/sdk/models/shared/journalentryrecordrefdatatype.md +20 -0
  215. package/docs/sdk/models/shared/journallinetracking.md +3 -3
  216. package/docs/sdk/models/shared/pulloperations.md +7 -7
  217. package/docs/sdk/models/shared/pushoperations.md +7 -7
  218. package/docs/sdk/models/shared/salesorderreference.md +4 -4
  219. package/docs/sdk/models/shared/sourcetype.md +2 -0
  220. package/docs/sdk/models/shared/tracking.md +1 -1
  221. package/docs/sdk/models/shared/trackingrecordref.md +11 -0
  222. package/docs/sdk/models/shared/trackingrecordrefdatatype.md +12 -0
  223. package/docs/sdk/models/shared/withholdingtaxitems.md +9 -0
  224. package/docs/sdks/accountbalances/README.md +1 -1
  225. package/docs/sdks/accounts/README.md +2 -2
  226. package/docs/sdks/accounttransactions/README.md +2 -2
  227. package/docs/sdks/balancesheet/README.md +2 -2
  228. package/docs/sdks/bankaccounts/README.md +2 -2
  229. package/docs/sdks/banktransactions/README.md +2 -2
  230. package/docs/sdks/billcreditnotes/README.md +2 -2
  231. package/docs/sdks/billpayments/README.md +2 -2
  232. package/docs/sdks/bills/README.md +5 -5
  233. package/docs/sdks/cashflow/README.md +1 -1
  234. package/docs/sdks/categorizedstatement/README.md +1 -1
  235. package/docs/sdks/codatlendingaccountingbankdata/README.md +1 -1
  236. package/docs/sdks/codatlendingaccounts/README.md +2 -2
  237. package/docs/sdks/codatlendingbankingtransactions/README.md +2 -2
  238. package/docs/sdks/codatlendingcustomers/README.md +2 -2
  239. package/docs/sdks/codatlendingdirectcosts/README.md +5 -5
  240. package/docs/sdks/codatlendingfinancialstatementsaccounts/README.md +2 -2
  241. package/docs/sdks/codatlendingloanwritebackaccounts/README.md +2 -2
  242. package/docs/sdks/codatlendingpayments/README.md +4 -3
  243. package/docs/sdks/codatlendingreports/README.md +2 -2
  244. package/docs/sdks/codatlendingsalespayments/README.md +2 -2
  245. package/docs/sdks/codatlendingsuppliers/README.md +26 -7
  246. package/docs/sdks/codatlendingtransactions/README.md +2 -2
  247. package/docs/sdks/codatlendingtransfers/README.md +2 -2
  248. package/docs/sdks/companies/README.md +38 -13
  249. package/docs/sdks/companyinfo/README.md +2 -2
  250. package/docs/sdks/connections/README.md +5 -5
  251. package/docs/sdks/createoperations/README.md +2 -2
  252. package/docs/sdks/creditnotes/README.md +2 -2
  253. package/docs/sdks/customers/README.md +5 -5
  254. package/docs/sdks/dataintegrity/README.md +3 -3
  255. package/docs/sdks/directcosts/README.md +10 -11
  256. package/docs/sdks/directincomes/README.md +5 -5
  257. package/docs/sdks/disputes/README.md +2 -2
  258. package/docs/sdks/excelreports/README.md +3 -3
  259. package/docs/sdks/fileupload/README.md +3 -3
  260. package/docs/sdks/invoices/README.md +7 -7
  261. package/docs/sdks/journalentries/README.md +2 -2
  262. package/docs/sdks/journals/README.md +2 -2
  263. package/docs/sdks/liabilities/README.md +4 -4
  264. package/docs/sdks/locations/README.md +2 -2
  265. package/docs/sdks/managedata/README.md +1 -1
  266. package/docs/sdks/metrics/README.md +3 -3
  267. package/docs/sdks/orders/README.md +2 -2
  268. package/docs/sdks/paymentmethods/README.md +2 -2
  269. package/docs/sdks/payments/README.md +2 -2
  270. package/docs/sdks/productcategories/README.md +2 -2
  271. package/docs/sdks/products/README.md +2 -2
  272. package/docs/sdks/profitandloss/README.md +2 -2
  273. package/docs/sdks/pulloperations/README.md +2 -2
  274. package/docs/sdks/refresh/README.md +2 -2
  275. package/docs/sdks/reports/README.md +4 -4
  276. package/docs/sdks/suppliers/README.md +5 -5
  277. package/docs/sdks/transactioncategories/README.md +2 -2
  278. package/docs/sdks/transfers/README.md +3 -4
  279. package/package.json +1 -1
  280. package/docs/sdk/models/shared/accountingdirectcostcontactref.md +0 -11
  281. package/docs/sdk/models/shared/directcostprototypecontactref.md +0 -11
@@ -0,0 +1,703 @@
1
+ # ~~AccountingCreatePaymentResponseAccountingPayment~~
2
+
3
+ > **Payments or bill payments?**
4
+ >
5
+ > In Codat, payments represent accounts receivable only. For accounts payable, see [bill payments](https://docs.codat.io/lending-api#/schemas/BillPayment). These include [bills](https://docs.codat.io/lending-api#/schemas/Bill) and credit notes against bills.
6
+
7
+ > View the coverage for payments in the <a className="external" href="https://knowledge.codat.io/supported-features/accounting?view=tab-by-data-type&dataType=payments" target="_blank">Data coverage explorer</a>.
8
+
9
+ ## Overview
10
+
11
+ Payments include all accounts receivable transaction data. This includes [invoices](https://docs.codat.io/lending-api#/schemas/Invoice) and [credit notes](https://docs.codat.io/lending-api#/schemas/CreditNote).
12
+
13
+ A payment in Codat usually represents an allocation of money within any customer accounts receivable account. This includes, but is not strictly limited to:
14
+
15
+ - A payment made against an invoice, like a credit card, cheque, or cash payment.
16
+ - An allocation of a customer's credit note, either to an invoice or maybe a refund.
17
+ - A payment made directly to that accounts receivable account. This might be an overpayment or a prepayment. It might also be the refund of a payment made directly to an accounts receivable account.
18
+
19
+ Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details.
20
+
21
+ In Codat, a payment contains details of:
22
+
23
+ - When the payment was recorded in the accounting system.
24
+ - How much it is for and in what currency that amount is in.
25
+ - Who the payment was _paid by_ – the _customer_.
26
+ - The payment method used.
27
+ - The breakdown of the types of payments – the _line items_.
28
+
29
+ Payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction).
30
+
31
+ ## Payment types
32
+
33
+ ## Payment of an invoice
34
+
35
+ A payment paying a single invoice has one entry in its `lines` array. This **line** has the following properties:
36
+
37
+ - An _amount_ that indicates the amount of the invoice that was paid. This is always positive.
38
+ - A **links** array containing one element with the following properties:
39
+ - A **type** that indicates the type of **link**, in this case an `Invoice`.
40
+ - An **id** that contains the ID of the invoice that was paid.
41
+ - An **amount** for the link. The sum of the **line.amount** and the **links.amount** must equal `0`.
42
+
43
+ The **amount** field on the **line** equals the **totalAmount** on the payment.
44
+
45
+ ## Payment of multiple invoices
46
+
47
+ A single payment can pay multiple invoices. This can be represented in one of two formats depending on how the customer keeps their books:
48
+
49
+ - The payment has multiple entries in its **lines** array, one for each invoice that is paid. Each line follows the example and rules described in [Payment of an invoice](#payment-of-an-invoice).
50
+ - The payment has a line with multiple links to each invoice. This occurs when the proportion of the original payment allocated to each invoice is not available.
51
+
52
+ Each **line** has the same properties as those described in [Payment of an invoice](#payment-of-an-invoice), with the **amount** indicating how much of the payment was allocated to the invoice. The sum of line amounts equals the **totalAmount** on the payment.
53
+
54
+ ## Payments and refunds on account
55
+
56
+ A payment on account, that is a payment that doesn’t pay a specific invoice, has one entry in its lines array. The **line** has the following properties:
57
+
58
+ - A **totalAmount** that indicates the amount paid by a customer or refunded to them by a company. A payment to the customer is always negative. A refund is always positive.
59
+ - A **links** array containing one element with the following properties:
60
+ - A **type** that indicates the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`.
61
+ - The **id** containing the ID of the customer.
62
+ - The **amount** for the link is `0` – the **totalAmount** _or_ the amount of the payment or refund.
63
+
64
+ It is possible to have a payment that is part _on account_ and part _allocated_ to an invoice. Each line should follow the examples above.
65
+
66
+ ## Using a credit note to pay an invoice
67
+
68
+ The payment of an invoice using a credit note has one entry in its **lines** array. This **line** has the following properties:
69
+
70
+ - An **amount** that indicates the amount of money moved, which in this case is `0`, as the credit note and invoice allocation must balance each other.
71
+ - A **links** array containing two elements:
72
+ - The first **link** has:
73
+ - A **type** that indicates the type of **link**, in this case an `Invoice`.
74
+ - An **id** that contains the ID of the invoice that was paid.
75
+ - The second **link** has:
76
+ - A **type** that indicates the type of **link**, in this case a `CreditNote`.
77
+ - An **id** that contains the ID of the credit note used by this payment.
78
+
79
+ The **amount** field on the **line** equals the **totalAmount** on the payment.
80
+
81
+ ## Refunding a credit note
82
+
83
+ A payment refunding a credit note has one entry in its **lines** array. This **line** has the following properties:
84
+
85
+ - An **amount** that indicates the amount of the credit note that was refunded. This is always negative for a refund.
86
+ - A **links** array that contains one element with the following properties:
87
+ - A **type** that indicates the type of **link**, in this case a `CreditNote`.
88
+ - An **id** that contains the ID of the credit note that was refunded.
89
+
90
+ The **totalAmount** field on the payment equals the **amount** field of the **line**. These are both negative, as this is money leaving accounts receivable.
91
+
92
+ ## Refunding a payment
93
+
94
+ If a payment is refunded, for example, if a customer overpaid an invoice and the overpayment is returned to the customer, there are two payment records:
95
+
96
+ - One for the incoming over payment.
97
+ - Another for the outgoing refund.
98
+
99
+ The payment issuing the refund has a negative **totalAmount**. This payment also has one entry in its lines array with the following properties:
100
+
101
+ - An **amount** that indicates the amount that was refunded. This is always negative.
102
+ - A **links** array that contains one element with the following properties:
103
+ - A **type** that indicates the type of **link**, in this case a `Payment`.
104
+ - An **id** that contains the ID of the payment that was refunded.
105
+
106
+ The **amount** field on the **line** equals the **totalAmount** on the payment and is negative, as this is money leaving accounts receivable.
107
+
108
+ The payment that was refunded has a line where the **amount** is positive and the type of the link is `Refund`. This payment may have several entries in its **lines** array if it was used to partly pay an invoice.
109
+
110
+ For example: A £1,050 payment on a £1,000 invoice with a refund of £50 has two lines:
111
+
112
+ - One for £1,000 linked to the invoice that was paid.
113
+ - Another for £50 linked to the payment that refunded the overpayment with a** type** of `Refund` and an ID that corresponds to the payment.
114
+
115
+ The **line** linked to the payment has the following properties:
116
+
117
+ - An **amount** that indicates the amount that was refunded. This is positive as its money that was added to accounts receivable. It's balanced out by the negative amount of the refund.
118
+ - A **links** array containing one element with the following properties:
119
+ - A **type** that indicates the type of **link**, in this case a `Refund`.
120
+ - An **id** that contains the ID of the payment that refunded this line.
121
+
122
+ > **Support for linked payments**
123
+ >
124
+ > Not all accounting packages support linking payments in this way. In some platforms, you may see a payment on account and a refund on account.
125
+
126
+ ## Foreign currencies
127
+
128
+ There are two types of currency rate that are included in the payments data type:
129
+
130
+ Payment currency rate:
131
+
132
+ - Base currency of the accounts receivable account.
133
+ - Foreign currency of the payment.
134
+
135
+ Payment line link currency rate:
136
+
137
+ - Base currency of the item the link represents.
138
+ - Foreign currency of the payment.
139
+
140
+ These two rates allow the calculation of currency loss or gain for any of the transactions affected by the payment lines. The second rate is used when a payment is applied to an item in a currency that doesn't match either:
141
+
142
+ - The base currency for the accounts receivable account.
143
+ - The currency of the item.
144
+
145
+ ```json title="Currency rate example"
146
+ {
147
+ "id": "123",
148
+ "note": "",
149
+ "totalAmount": 99.99,
150
+ "currency": "GBP",
151
+ "lines": [
152
+ {
153
+ "amount": 99.99,
154
+ "links": [
155
+ {
156
+ "type": "Invoice",
157
+ "id": "178",
158
+ "amount": -50,
159
+ "currencyRate": 1.9998
160
+ }
161
+ ]
162
+ }
163
+ ]
164
+ }
165
+ ```
166
+
167
+
168
+
169
+ ## Example data
170
+
171
+ > **Object properties**
172
+ >
173
+ > For the sake of brevity, the examples here may omit properties from objects. For the full object definition, see [Payments](https://api.codat.io/swagger/index.html#/Payments).
174
+
175
+ ## Simple examples
176
+
177
+ ```json title="Payment for invoice"
178
+ {
179
+ "totalAmount": 1000,
180
+ "lines": [
181
+ {
182
+ "amount" : 1000,
183
+ "links" : [
184
+ {
185
+ "type" : "Invoice",
186
+ "id" : "x",
187
+ "amount" : -1000
188
+ }
189
+ ]
190
+ }
191
+ ]
192
+ }
193
+ ```
194
+
195
+
196
+
197
+ ```json title="Allocation of credit note"
198
+ {
199
+ "totalAmount": 0,
200
+ "lines": [
201
+ {
202
+ "amount" : 0,
203
+ "links" : [
204
+ {
205
+ "type" : "Invoice",
206
+ "id" : "x",
207
+ "amount" : -1000
208
+ },
209
+ {
210
+ "type" : "CreditNote",
211
+ "id" : "y",
212
+ "amount" : 1000
213
+ }
214
+ ]
215
+ }
216
+ ]
217
+ }
218
+ ```
219
+
220
+
221
+
222
+ ```json title="Payment of invoice and payment on account"
223
+ {
224
+ "totalAmount": 2000,
225
+ "lines": [
226
+ {
227
+ "amount" : 1000,
228
+ "links" : [
229
+ {
230
+ "type" : "Invoice",
231
+ "id" : "x",
232
+ "amount" : -1000
233
+ }
234
+ ]
235
+ },
236
+ {
237
+ "amount" : 1000,
238
+ "links" : [
239
+ {
240
+ "type" : "PaymentOnAccount",
241
+ "id" : "y",
242
+ "amount" : -1000
243
+ }
244
+ ]
245
+ }
246
+ ]
247
+ }
248
+ ```
249
+
250
+
251
+
252
+ ```json title="Refund of credit note"
253
+ {
254
+ "totalAmount": -1000,
255
+ "lines": [
256
+ {
257
+ "amount" : -1000,
258
+ "links" : [
259
+ {
260
+ "type" : "CreditNote",
261
+ "id" : "y",
262
+ "amount" : 1000
263
+ }
264
+ ]
265
+ }
266
+ ]
267
+ }
268
+ ```
269
+
270
+
271
+
272
+ ```json title="Refund on accounts receivable account"
273
+ {
274
+ "totalAmount": -1000,
275
+ "lines": [
276
+ {
277
+ "amount" : -1000,
278
+ "links" : [
279
+ {
280
+ "type" : "PaymentOnAccount",
281
+ "id" : "y",
282
+ "amount" : 1000
283
+ }
284
+ ]
285
+ }
286
+ ]
287
+ }
288
+ ```
289
+
290
+
291
+
292
+ ```json title="Linked refund on accounts receivable account"
293
+ {
294
+ "id" : "payment-001",
295
+ "totalAmount": 1000,
296
+ "lines": [
297
+ {
298
+ "amount" : 1000,
299
+ "links" : [
300
+ {
301
+ "type" : "Refund",
302
+ "id" : "refund-001",
303
+ "amount" : -1000
304
+ }
305
+ ]
306
+ }
307
+ ]
308
+ }
309
+ {
310
+ "id" : "refund-001",
311
+ "totalAmount": -1000,
312
+ "lines": [
313
+ {
314
+ "amount" : -1000,
315
+ "links" : [
316
+ {
317
+ "type" : "Payment",
318
+ "id" : "payment-001",
319
+ "amount" : 1000
320
+ }
321
+ ]
322
+ }
323
+ ]
324
+ }
325
+ ```
326
+
327
+
328
+
329
+ ```json title="Using a credit note and cash to pay an invoice"
330
+ {
331
+ "totalAmount": 250,
332
+ "lines": [
333
+ {
334
+ "amount": 0,
335
+ "links": [
336
+ {
337
+ "type": "Invoice",
338
+ "id": "x",
339
+ "amount": -750
340
+ },
341
+ {
342
+ "type": "CreditNote",
343
+ "id": "y",
344
+ "amount": 750
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "amount": 250,
350
+ "links": [
351
+ {
352
+ "type": "Invoice",
353
+ "id": "x",
354
+ "amount": -250
355
+ }
356
+ ]
357
+ }
358
+ ]
359
+ }
360
+ ```
361
+
362
+
363
+
364
+ ## Complex examples
365
+
366
+ ```json title="Use two credit notes and 1000 in to "bank" (cash, cheque etc.) to pay invoice"
367
+ {
368
+ "totalAmount": 1000,
369
+ "lines": [
370
+ {
371
+ "amount" : 0,
372
+ "links" : [
373
+ {
374
+ "type" : "Invoice",
375
+ "id" : "x",
376
+ "amount" : -1000
377
+ },
378
+ {
379
+ "type" : "CreditNote",
380
+ "id" : "y",
381
+ "amount" : 1000
382
+ }
383
+ ]
384
+ },
385
+ {
386
+ "amount" : 0,
387
+ "links" : [
388
+ {
389
+ "type" : "Invoice",
390
+ "id" : "x",
391
+ "amount" : -1000
392
+ },
393
+ {
394
+ "type" : "CreditNote",
395
+ "id" : "z",
396
+ "amount" : 1000
397
+ }
398
+ ]
399
+ },
400
+ {
401
+ "amount" : 1000,
402
+ "links" : [
403
+ {
404
+ "type" : "Invoice",
405
+ "id" : "x",
406
+ "amount" : -1000
407
+ }
408
+ ]
409
+ }
410
+ ]
411
+ }
412
+ ```
413
+
414
+
415
+
416
+ ```json title="Pay an invoice with two credit notes and cash, with 1000 left 'on account'"
417
+ {
418
+ "totalAmount": 2000,
419
+ "lines": [
420
+ {
421
+ "amount" : 0,
422
+ "links" : [
423
+ {
424
+ "type" : "Invoice",
425
+ "id" : "x",
426
+ "amount" : -1000
427
+ },
428
+ {
429
+ "type" : "CreditNote",
430
+ "id" : "y",
431
+ "amount" : 1000
432
+ }
433
+ ]
434
+ },
435
+ {
436
+ "amount" : 0,
437
+ "links" : [
438
+ {
439
+ "type" : "Invoice",
440
+ "id" : "x",
441
+ "amount" : -1000
442
+ },
443
+ {
444
+ "type" : "CreditNote",
445
+ "id" : "z",
446
+ "amount" : 1000
447
+ }
448
+ ]
449
+ },
450
+ {
451
+ "amount" : 1000,
452
+ "links" : [
453
+ {
454
+ "type" : "Invoice",
455
+ "id" : "x",
456
+ "amount" : -1000
457
+ }
458
+ ]
459
+ },
460
+ {
461
+ "amount" : 1000,
462
+ "links" : [
463
+ {
464
+ "type" : "PaymentOnAccount",
465
+ "id" : "customer-001",
466
+ "amount" : -1000
467
+ }
468
+ ]
469
+ }
470
+ ]
471
+ }
472
+ ```
473
+
474
+
475
+
476
+ ```json title="Two credit notes pay two invoices with no allocation amount specified"
477
+ {
478
+ "totalAmount": 0,
479
+ "lines": [
480
+ {
481
+ "amount" : 0,
482
+ "links" : [
483
+ {
484
+ "type" : "Invoice",
485
+ "id" : "w",
486
+ "amount" : -1000
487
+ },
488
+ {
489
+ "type" : "Invoice",
490
+ "id" : "x",
491
+ "amount" : -1000
492
+ },
493
+ {
494
+ "type" : "CreditNote",
495
+ "id" : "y",
496
+ "amount" : 1000
497
+ },
498
+ {
499
+ "type" : "CreditNote",
500
+ "id" : "z",
501
+ "amount" : 1000
502
+ }
503
+ ]
504
+ }
505
+ ]
506
+ }
507
+ ```
508
+
509
+
510
+
511
+ ```json title="Two credit notes and cash pay three invoices with no allocation amount specified, and refund cash"
512
+ {
513
+ "totalAmount": 2000,
514
+ "lines": [
515
+ {
516
+ "amount" : 1000,
517
+ "links" : [
518
+ {
519
+ "type" : "Invoice",
520
+ "id" : "w",
521
+ "amount" : -1000
522
+ },
523
+ {
524
+ "type" : "Invoice",
525
+ "id" : "x",
526
+ "amount" : -1000
527
+ },
528
+ {
529
+ "type" : "Invoice",
530
+ "id" : "u",
531
+ "amount" : -1000
532
+ },
533
+ {
534
+ "type" : "CreditNote",
535
+ "id" : "y",
536
+ "amount" : 1000
537
+ },
538
+ {
539
+ "type" : "CreditNote",
540
+ "id" : "z",
541
+ "amount" : 1000
542
+ }
543
+ ]
544
+ },
545
+ {
546
+ "amount" : 1000,
547
+ "links" : [
548
+ {
549
+ "type" : "Refund",
550
+ "id" : "refund-001",
551
+ "amount" : -1000
552
+ }
553
+ ]
554
+ }
555
+ ]
556
+ }
557
+ {
558
+ "id" : "refund-001",
559
+ "totalAmount": -1000,
560
+ "lines": [
561
+ {
562
+ "amount" : -1000,
563
+ "links" : [
564
+ {
565
+ "type" : "Payment",
566
+ "id" : "payment-001",
567
+ "amount" : 1000
568
+ }
569
+ ]
570
+ }
571
+ ]
572
+ }
573
+ ```
574
+
575
+
576
+
577
+ In this example, a payment on account is used to pay the same invoice in January and again in February.
578
+
579
+ ```json title="January"
580
+ {
581
+ "id": "001",
582
+ "totalAmount": 5000,
583
+ "date" : "1901-01-01",
584
+ "lines": [
585
+ {
586
+ "amount" : 1000,
587
+ "links" : [
588
+ {
589
+ "type" : "Invoice",
590
+ "id" : "Invoice-x",
591
+ "amount" : -1000
592
+ }
593
+ ]
594
+ },
595
+ {
596
+ "amount" : 4000,
597
+ "links" : [
598
+ {
599
+ "type" : "PaymentOnAccount",
600
+ "id" : "PaymentOnAccount-y",
601
+ "amount" : -4000
602
+ }
603
+ ]
604
+ }
605
+ ]
606
+ }
607
+ ```
608
+
609
+
610
+
611
+ ```json title="February"
612
+ {
613
+ "id": "001",
614
+ "totalAmount": 5000,
615
+ "date" : "1901-02-01",
616
+ "lines": [
617
+ {
618
+ "amount" : 1000,
619
+ "links" : [
620
+ {
621
+ "type" : "Invoice",
622
+ "id" : "Invoice-x",
623
+ "amount" : -1000
624
+ }
625
+ ]
626
+ },
627
+ {
628
+ "amount" : 1000,
629
+ "links" : [
630
+ {
631
+ "type" : "Invoice",
632
+ "id" : "Invoice-y",
633
+ "amount" : -1000
634
+ }
635
+ ]
636
+ },
637
+ {
638
+ "amount" : 3000,
639
+ "links" : [
640
+ {
641
+ "type" : "PaymentOnAccount",
642
+ "id" : "PaymentOnAccount-y",
643
+ "amount" : -3000
644
+ }
645
+ ]
646
+ }
647
+ ]
648
+ }
649
+ ```
650
+
651
+
652
+
653
+ ```json title="Two credit notes and some cash pay two invoices with no allocations specified"
654
+ {
655
+ "totalAmount": 500,
656
+ "lines": [
657
+ {
658
+ "amount": 500,
659
+ "links": [{
660
+ "type": "Invoice",
661
+ "id": "a",
662
+ "amount": -1000
663
+ }, {
664
+ "type": "Invoice",
665
+ "id": "b",
666
+ "amount": -1000
667
+ }, {
668
+ "type": "CreditNote",
669
+ "id": "y",
670
+ "amount": 750
671
+ },{
672
+ "type": "CreditNote",
673
+ "id": "z",
674
+ "amount": 750
675
+ }
676
+ ]
677
+ }
678
+ ]
679
+ }
680
+ ```
681
+
682
+ > :warning: **DEPRECATED**: This will be removed in a future release, please migrate away from it as soon as possible.
683
+
684
+
685
+ ## Fields
686
+
687
+ | Field | Type | Required | Description | Example |
688
+ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
689
+ | `accountRef` | [shared.AccountRef](../../../sdk/models/shared/accountref.md) | :heavy_minus_sign: | Data types that reference an account, for example bill and invoice line items, use an accountRef that includes the ID and name of the linked account. | |
690
+ | `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_.<br/><br/>## Unknown currencies<br/><br/>In line with the ISO 4217 specification, the code _XXX_ is used when the data source does not return a currency for a transaction. <br/><br/>There are only a very small number of edge cases where this currency code is returned by the Codat system. | GBP |
691
+ | `currencyRate` | *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.<br/><br/>Currency rates in Codat are implemented as the multiple of foreign currency units to each base currency unit. <br/><br/>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.<br/><br/>Where the currency rate is provided by the underlying accounting platform, it will be available from Codat with the same precision (up to a maximum of 9 decimal places). <br/><br/>For accounting platforms which do not provide an explicit currency rate, it is calculated as `baseCurrency / foreignCurrency` and will be returned to 9 decimal places.<br/><br/>## Examples with base currency of GBP<br/><br/>\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (GBP) \|<br/>\| :--------------- \| :------------- \| :------------ \| :------------------------- \|<br/>\| **USD** \| $20 \| 0.781 \| £15.62 \|<br/>\| **EUR** \| €20 \| 0.885 \| £17.70 \|<br/>\| **RUB** \| ₽20 \| 0.011 \| £0.22 \|<br/><br/>## Examples with base currency of USD<br/><br/>\| Foreign Currency \| Foreign Amount \| Currency Rate \| Base Currency Amount (USD) \|<br/>\| :--------------- \| :------------- \| :------------ \| :------------------------- \|<br/>\| **GBP** \| £20 \| 1.277 \| $25.54 \|<br/>\| **EUR** \| €20 \| 1.134 \| $22.68 \|<br/>\| **RUB** \| ₽20 \| 0.015 \| $0.30 \|<br/><br/><br/>### Integration-specific details<br/><br/>\| Integration \| Scenario \| System behavior \|<br/>\|-------------------\|-------------------------------------------------\|----------------------------------------------------------------------------------------------------------------------------------------------------------------------\|<br/>\| QuickBooks Online \| Transaction currency differs from base currency \| If currency rate value is left `null`, a rate of 1 will be used by QBO by default. To override this, include the required currency rate in the expense transaction. \| | |
692
+ | `customerRef` | [shared.AccountingCustomerRef](../../../sdk/models/shared/accountingcustomerref.md) | :heavy_minus_sign: | N/A | |
693
+ | `date` | *string* | :heavy_check_mark: | In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:<br/><br/>```<br/>2020-10-08T22:40:50Z<br/>2021-01-01T00:00:00<br/>```<br/><br/><br/><br/>When syncing data that contains `DateTime` fields from Codat, make sure you support the following cases when reading time information:<br/><br/>- Coordinated Universal Time (UTC): `2021-11-15T06:00:00Z`<br/>- Unqualified local time: `2021-11-15T01:00:00`<br/>- UTC time offsets: `2021-11-15T01:00:00-05:00`<br/><br/>> Time zones<br/>> <br/>> Not all dates from Codat will contain information about time zones. <br/>> Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced. | 2022-10-23 00:00:00 +0000 UTC |
694
+ | `id` | *string* | :heavy_minus_sign: | Identifier for the payment, unique to the company in the accounting platform. | |
695
+ | `lines` | [shared.PaymentLine](../../../sdk/models/shared/paymentline.md)[] | :heavy_minus_sign: | An array of payment lines. | |
696
+ | `metadata` | [shared.Metadata](../../../sdk/models/shared/metadata.md) | :heavy_minus_sign: | N/A | |
697
+ | `modifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC |
698
+ | `note` | *string* | :heavy_minus_sign: | Any additional information associated with the payment. | |
699
+ | `paymentMethodRef` | [shared.PaymentMethodRef](../../../sdk/models/shared/paymentmethodref.md) | :heavy_minus_sign: | The payment method the record is linked to in the accounting or commerce platform. | {"id":"EILBDVJVNUAGVKRQ","name":"AliPay"} |
700
+ | `reference` | *string* | :heavy_minus_sign: | Friendly reference for the payment. | |
701
+ | `sourceModifiedDate` | *string* | :heavy_minus_sign: | N/A | 2022-10-23 00:00:00 +0000 UTC |
702
+ | `supplementalData` | [shared.SupplementalData](../../../sdk/models/shared/supplementaldata.md) | :heavy_minus_sign: | Supplemental data is additional data you can include in our standard data types. <br/><br/>It is referenced as a configured dynamic key value pair that is unique to the accounting platform. [Learn more](https://docs.codat.io/using-the-api/supplemental-data/overview) about supplemental data. | |
703
+ | `totalAmount` | *number* | :heavy_minus_sign: | Amount of the payment in the payment currency. This value should never change and represents the amount of money paid into the customer's account. | |