@codat/lending 4.1.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.
- package/README.md +36 -1
- package/dist/sdk/companies.d.ts +22 -7
- package/dist/sdk/companies.js +22 -7
- package/dist/sdk/fileupload.js +1 -1
- package/dist/sdk/models/operations/getcreateoperation.d.ts +1 -1
- package/dist/sdk/models/operations/uploadfiles.d.ts +1 -5
- package/dist/sdk/models/operations/uploadfiles.js +4 -22
- package/dist/sdk/models/shared/accountingbillcreditnote.d.ts +2 -2
- package/dist/sdk/models/shared/accountingbillcreditnote.js +3 -3
- package/dist/sdk/models/shared/accountingcreateaccountresponse.d.ts +171 -34
- package/dist/sdk/models/shared/accountingcreateaccountresponse.js +194 -4
- package/dist/sdk/models/shared/accountingcreatebankaccountresponse.d.ts +116 -22
- package/dist/sdk/models/shared/accountingcreatebankaccountresponse.js +118 -4
- package/dist/sdk/models/shared/accountingcreatebanktransactionsresponse.d.ts +12 -2
- package/dist/sdk/models/shared/accountingcreatebanktransactionsresponse.js +26 -4
- package/dist/sdk/models/shared/accountingcreatedirectcostresponse.d.ts +165 -18
- package/dist/sdk/models/shared/accountingcreatedirectcostresponse.js +150 -4
- package/dist/sdk/models/shared/accountingcreatepaymentresponse.d.ts +797 -675
- package/dist/sdk/models/shared/accountingcreatepaymentresponse.js +782 -4
- package/dist/sdk/models/shared/accountingcreatesupplierresponse.d.ts +69 -11
- package/dist/sdk/models/shared/accountingcreatesupplierresponse.js +99 -4
- package/dist/sdk/models/shared/accountingcreatetransferresponse.d.ts +81 -9
- package/dist/sdk/models/shared/accountingcreatetransferresponse.js +93 -4
- package/dist/sdk/models/shared/accountingcreditnote.d.ts +2 -2
- package/dist/sdk/models/shared/accountingcreditnote.js +3 -3
- package/dist/sdk/models/shared/accountingdirectcost.d.ts +11 -5
- package/dist/sdk/models/shared/accountingdirectcost.js +18 -11
- package/dist/sdk/models/shared/accountinginvoice.d.ts +10 -5
- package/dist/sdk/models/shared/accountinginvoice.js +11 -5
- package/dist/sdk/models/shared/accountingjournalentry.d.ts +3 -7
- package/dist/sdk/models/shared/accountingjournalentry.js +3 -3
- package/dist/sdk/models/shared/accounttransactionline.d.ts +3 -7
- package/dist/sdk/models/shared/accounttransactionline.js +3 -3
- package/dist/sdk/models/shared/accounttransactionlinerecordref.d.ts +30 -0
- package/dist/sdk/models/shared/accounttransactionlinerecordref.js +70 -0
- package/dist/sdk/models/shared/bankingtransactioncategory.d.ts +5 -1
- package/dist/sdk/models/shared/bankingtransactioncategory.js +5 -1
- package/dist/sdk/models/shared/codatfile.d.ts +5 -0
- package/dist/sdk/models/shared/codatfile.js +47 -0
- package/dist/sdk/models/shared/company.d.ts +10 -0
- package/dist/sdk/models/shared/company.js +20 -1
- package/dist/sdk/models/shared/companyrequestbody.d.ts +5 -0
- package/dist/sdk/models/shared/companyrequestbody.js +7 -0
- package/dist/sdk/models/shared/connection.d.ts +2 -0
- package/dist/sdk/models/shared/connection.js +2 -0
- package/dist/sdk/models/shared/contactref.d.ts +9 -3
- package/dist/sdk/models/shared/contactref.js +9 -2
- package/dist/sdk/models/shared/directcostprototype.d.ts +11 -5
- package/dist/sdk/models/shared/directcostprototype.js +18 -11
- package/dist/sdk/models/shared/errormessage.d.ts +5 -0
- package/dist/sdk/models/shared/errormessage.js +7 -0
- package/dist/sdk/models/shared/errorvalidation.d.ts +9 -0
- package/dist/sdk/models/shared/errorvalidation.js +56 -0
- package/dist/sdk/models/shared/errorvalidationitem.d.ts +15 -0
- package/dist/sdk/models/shared/errorvalidationitem.js +55 -0
- package/dist/sdk/models/shared/fileupload.d.ts +8 -0
- package/dist/sdk/models/shared/fileupload.js +44 -0
- package/dist/sdk/models/shared/index.d.ts +8 -0
- package/dist/sdk/models/shared/index.js +8 -0
- package/dist/sdk/models/shared/invoicelineitem.d.ts +0 -2
- package/dist/sdk/models/shared/items.d.ts +2 -6
- package/dist/sdk/models/shared/items.js +2 -7
- package/dist/sdk/models/shared/journalentryrecordref.d.ts +30 -0
- package/dist/sdk/models/shared/journalentryrecordref.js +70 -0
- package/dist/sdk/models/shared/journalline.d.ts +2 -2
- package/dist/sdk/models/shared/journalline.js +3 -3
- package/dist/sdk/models/shared/tracking.d.ts +2 -1
- package/dist/sdk/models/shared/tracking.js +3 -2
- package/dist/sdk/models/shared/trackingrecordref.d.ts +22 -0
- package/dist/sdk/models/shared/trackingrecordref.js +62 -0
- package/dist/sdk/models/shared/withholdingtaxitems.d.ts +11 -0
- package/dist/sdk/models/shared/withholdingtaxitems.js +50 -0
- package/dist/sdk/sdk.js +3 -3
- package/docs/sdk/models/operations/createcompanyresponse.md +7 -7
- package/docs/sdk/models/operations/createconnectionresponse.md +7 -7
- package/docs/sdk/models/operations/createsupplierrequest.md +7 -7
- package/docs/sdk/models/operations/getaccountingagedcreditorsreportresponse.md +7 -7
- package/docs/sdk/models/operations/getaccountingageddebtorsreportresponse.md +7 -7
- package/docs/sdk/models/operations/getaccountingbillcreditnoteresponse.md +7 -7
- package/docs/sdk/models/operations/getaccountingbillpaymentresponse.md +7 -7
- package/docs/sdk/models/operations/getaccountingcreditnoteresponse.md +7 -7
- package/docs/sdk/models/operations/getaccountingprofileresponse.md +7 -7
- package/docs/sdk/models/operations/getaccountingsupplierresponse.md +7 -7
- package/docs/sdk/models/operations/getbankingaccountresponse.md +7 -7
- package/docs/sdk/models/operations/getbankingtransactioncategoryresponse.md +7 -7
- package/docs/sdk/models/operations/getbankingtransactionresponse.md +7 -7
- package/docs/sdk/models/operations/getcategorizedbalancesheetstatementresponse.md +7 -7
- package/docs/sdk/models/operations/getcategorizedprofitandlossstatementresponse.md +7 -7
- package/docs/sdk/models/operations/getcommercecustomerresponse.md +7 -7
- package/docs/sdk/models/operations/getcommercedisputeresponse.md +7 -7
- package/docs/sdk/models/operations/getcommercelocationresponse.md +7 -7
- package/docs/sdk/models/operations/getcommerceorderresponse.md +7 -7
- package/docs/sdk/models/operations/getcommerceproductcategoryresponse.md +7 -7
- package/docs/sdk/models/operations/getcompanyresponse.md +7 -7
- package/docs/sdk/models/operations/getconnectionresponse.md +7 -7
- package/docs/sdk/models/operations/getcreateoperationrequest.md +4 -4
- package/docs/sdk/models/operations/getloansummaryresponse.md +7 -7
- package/docs/sdk/models/operations/getpulloperationresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingaccountsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingaccounttransactionsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingbankaccountsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingbankaccounttransactionsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingbillcreditnotesresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingbillpaymentsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingbillsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingcreditnotesresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingcustomersresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingdirectcostsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingdirectincomesresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountinginvoicesresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingjournalentriesresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingjournalsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingpaymentsresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingsuppliersresponse.md +7 -7
- package/docs/sdk/models/operations/listaccountingtransfersresponse.md +7 -7
- package/docs/sdk/models/operations/listbankingaccountbalancesresponse.md +7 -7
- package/docs/sdk/models/operations/listbankingaccountsresponse.md +7 -7
- package/docs/sdk/models/operations/listbankingtransactioncategoriesresponse.md +7 -7
- package/docs/sdk/models/operations/listbankingtransactionsresponse.md +7 -7
- package/docs/sdk/models/operations/listcommercecustomersresponse.md +7 -7
- package/docs/sdk/models/operations/listcommercedisputesresponse.md +7 -7
- package/docs/sdk/models/operations/listcommercelocationsresponse.md +7 -7
- package/docs/sdk/models/operations/listcommerceordersresponse.md +7 -7
- package/docs/sdk/models/operations/listcommercepaymentmethodsresponse.md +7 -7
- package/docs/sdk/models/operations/listcommercepaymentsresponse.md +7 -7
- package/docs/sdk/models/operations/listcommerceproductcategoriesresponse.md +7 -7
- package/docs/sdk/models/operations/listcommerceproductsresponse.md +7 -7
- package/docs/sdk/models/operations/listcommercetransactionsresponse.md +7 -7
- package/docs/sdk/models/operations/listcompaniesresponse.md +7 -7
- package/docs/sdk/models/operations/listconnectionsresponse.md +7 -7
- package/docs/sdk/models/operations/listcreateoperationsresponse.md +7 -7
- package/docs/sdk/models/operations/listdataintegritydetailsresponse.md +7 -7
- package/docs/sdk/models/operations/listloantransactionsresponse.md +7 -7
- package/docs/sdk/models/operations/listpulloperationsresponse.md +7 -7
- package/docs/sdk/models/operations/refreshdatatyperesponse.md +7 -7
- package/docs/sdk/models/operations/unlinkconnectionresponse.md +7 -7
- package/docs/sdk/models/operations/updatecompanyresponse.md +7 -7
- package/docs/sdk/models/operations/uploadfilesrequest.md +5 -5
- package/docs/sdk/models/shared/accountingaccounts.md +7 -7
- package/docs/sdk/models/shared/accountingaccounttransactions.md +7 -7
- package/docs/sdk/models/shared/accountingbankaccounts.md +7 -7
- package/docs/sdk/models/shared/accountingbanktransactions.md +7 -7
- package/docs/sdk/models/shared/accountingbillcreditnote.md +1 -1
- package/docs/sdk/models/shared/accountingbillcreditnotes.md +7 -7
- package/docs/sdk/models/shared/accountingbillpayment.md +1 -1
- package/docs/sdk/models/shared/accountingbillpayments.md +7 -7
- package/docs/sdk/models/shared/accountingbills.md +7 -7
- package/docs/sdk/models/shared/accountingcreateaccountresponse.md +16 -16
- package/docs/sdk/models/shared/accountingcreateaccountresponseaccountingaccount.md +54 -0
- package/docs/sdk/models/shared/accountingcreateaccountresponsevaliddatatypelinks.md +50 -0
- package/docs/sdk/models/shared/accountingcreatebankaccountresponse.md +16 -16
- package/docs/sdk/models/shared/accountingcreatebankaccountresponseaccountingbankaccount.md +42 -0
- package/docs/sdk/models/shared/accountingcreatebankaccounttransactions.md +11 -0
- package/docs/sdk/models/shared/accountingcreatebanktransactionsresponse.md +1 -1
- package/docs/sdk/models/shared/accountingcreatedirectcostresponse.md +16 -16
- package/docs/sdk/models/shared/accountingcreatedirectcostresponseaccountingdirectcost.md +41 -0
- package/docs/sdk/models/shared/accountingcreatedirectcostresponsecontactreference.md +11 -0
- package/docs/sdk/models/shared/accountingcreatedirectcostresponsedatatype.md +11 -0
- package/docs/sdk/models/shared/accountingcreatepaymentresponse.md +16 -16
- package/docs/sdk/models/shared/accountingcreatepaymentresponseaccountingpayment.md +703 -0
- package/docs/sdk/models/shared/accountingcreatesupplierresponse.md +1 -1
- package/docs/sdk/models/shared/accountingcreatesupplierresponseaccountingsupplier.md +29 -0
- package/docs/sdk/models/shared/accountingcreatetransferresponse.md +1 -1
- package/docs/sdk/models/shared/accountingcreatetransferresponseaccountingtransfer.md +25 -0
- package/docs/sdk/models/shared/accountingcreditnote.md +1 -1
- package/docs/sdk/models/shared/accountingcreditnotes.md +7 -7
- package/docs/sdk/models/shared/accountingcustomers.md +7 -7
- package/docs/sdk/models/shared/accountingdirectcost.md +1 -1
- package/docs/sdk/models/shared/accountingdirectcostcontactreference.md +11 -0
- package/docs/sdk/models/shared/accountingdirectcostdatatype.md +11 -0
- package/docs/sdk/models/shared/accountingdirectcosts.md +7 -7
- package/docs/sdk/models/shared/accountingdirectincomes.md +7 -7
- package/docs/sdk/models/shared/accountinginvoice.md +1 -1
- package/docs/sdk/models/shared/accountinginvoicedatatype.md +10 -0
- package/docs/sdk/models/shared/accountinginvoices.md +7 -7
- package/docs/sdk/models/shared/accountingjournalentries.md +7 -7
- package/docs/sdk/models/shared/accountingjournalentry.md +1 -1
- package/docs/sdk/models/shared/accountingjournals.md +7 -7
- package/docs/sdk/models/shared/accountingpayment.md +1 -1
- package/docs/sdk/models/shared/accountingpayments.md +7 -7
- package/docs/sdk/models/shared/accountingsuppliers.md +7 -7
- package/docs/sdk/models/shared/accountingtransfers.md +7 -7
- package/docs/sdk/models/shared/accounts.md +1 -1
- package/docs/sdk/models/shared/accounttransactionline.md +5 -5
- package/docs/sdk/models/shared/accounttransactionlinerecordref.md +11 -0
- package/docs/sdk/models/shared/accounttransactionlinerecordrefdatatype.md +20 -0
- package/docs/sdk/models/shared/bankingaccountbalances.md +7 -7
- package/docs/sdk/models/shared/bankingaccounts.md +7 -7
- package/docs/sdk/models/shared/bankingtransactioncategories.md +7 -7
- package/docs/sdk/models/shared/bankingtransactioncategory.md +3 -1
- package/docs/sdk/models/shared/bankingtransactions.md +7 -7
- package/docs/sdk/models/{operations/uploadfilesrequestbody.md → shared/codatfile.md} +1 -1
- package/docs/sdk/models/shared/commercecustomers.md +7 -7
- package/docs/sdk/models/shared/commercedisputes.md +7 -7
- package/docs/sdk/models/shared/commercelocations.md +7 -7
- package/docs/sdk/models/shared/commerceorders.md +7 -7
- package/docs/sdk/models/shared/commercepayment.md +1 -1
- package/docs/sdk/models/shared/commercepaymentmethods.md +7 -7
- package/docs/sdk/models/shared/commercepayments.md +7 -7
- package/docs/sdk/models/shared/commerceproductcategories.md +7 -7
- package/docs/sdk/models/shared/commerceproducts.md +7 -7
- package/docs/sdk/models/shared/commercetransactions.md +7 -7
- package/docs/sdk/models/shared/companies.md +7 -7
- package/docs/sdk/models/shared/company.md +1 -0
- package/docs/sdk/models/shared/companyrequestbody.md +1 -0
- package/docs/sdk/models/shared/connections.md +7 -7
- package/docs/sdk/models/shared/contactref.md +4 -4
- package/docs/sdk/models/shared/contactrefdatatype.md +11 -0
- package/docs/sdk/models/shared/contactreference.md +11 -0
- package/docs/sdk/models/shared/dataintegritydetails.md +7 -7
- package/docs/sdk/models/shared/directcostprototype.md +1 -1
- package/docs/sdk/models/shared/directcostprototypedatatype.md +11 -0
- package/docs/sdk/models/shared/enhancedcashflowtransaction.md +2 -2
- package/docs/sdk/models/shared/enhancedcashflowtransactions.md +5 -5
- package/docs/sdk/models/shared/enhancedinvoicesreport.md +4 -4
- package/docs/sdk/models/shared/errormessage.md +9 -8
- package/docs/sdk/models/shared/errorvalidation.md +11 -0
- package/docs/sdk/models/shared/errorvalidationitem.md +10 -0
- package/docs/sdk/models/shared/fileupload.md +8 -0
- package/docs/sdk/models/shared/groupreference.md +8 -0
- package/docs/sdk/models/shared/invoicelineitem.md +1 -1
- package/docs/sdk/models/shared/items.md +3 -4
- package/docs/sdk/models/shared/journalentryrecordref.md +11 -0
- package/docs/sdk/models/shared/journalentryrecordrefdatatype.md +20 -0
- package/docs/sdk/models/shared/journallinetracking.md +3 -3
- package/docs/sdk/models/shared/pulloperations.md +7 -7
- package/docs/sdk/models/shared/pushoperations.md +7 -7
- package/docs/sdk/models/shared/salesorderreference.md +4 -4
- package/docs/sdk/models/shared/sourcetype.md +2 -0
- package/docs/sdk/models/shared/tracking.md +1 -1
- package/docs/sdk/models/shared/trackingrecordref.md +11 -0
- package/docs/sdk/models/shared/trackingrecordrefdatatype.md +12 -0
- package/docs/sdk/models/shared/withholdingtaxitems.md +9 -0
- package/docs/sdks/accountbalances/README.md +1 -1
- package/docs/sdks/accounts/README.md +2 -2
- package/docs/sdks/accounttransactions/README.md +2 -2
- package/docs/sdks/balancesheet/README.md +2 -2
- package/docs/sdks/bankaccounts/README.md +2 -2
- package/docs/sdks/banktransactions/README.md +2 -2
- package/docs/sdks/billcreditnotes/README.md +2 -2
- package/docs/sdks/billpayments/README.md +2 -2
- package/docs/sdks/bills/README.md +5 -5
- package/docs/sdks/cashflow/README.md +1 -1
- package/docs/sdks/categorizedstatement/README.md +1 -1
- package/docs/sdks/codatlendingaccountingbankdata/README.md +1 -1
- package/docs/sdks/codatlendingaccounts/README.md +2 -2
- package/docs/sdks/codatlendingbankingtransactions/README.md +2 -2
- package/docs/sdks/codatlendingcustomers/README.md +2 -2
- package/docs/sdks/codatlendingdirectcosts/README.md +5 -5
- package/docs/sdks/codatlendingfinancialstatementsaccounts/README.md +2 -2
- package/docs/sdks/codatlendingloanwritebackaccounts/README.md +2 -2
- package/docs/sdks/codatlendingpayments/README.md +4 -3
- package/docs/sdks/codatlendingreports/README.md +2 -2
- package/docs/sdks/codatlendingsalespayments/README.md +2 -2
- package/docs/sdks/codatlendingsuppliers/README.md +26 -7
- package/docs/sdks/codatlendingtransactions/README.md +2 -2
- package/docs/sdks/codatlendingtransfers/README.md +2 -2
- package/docs/sdks/companies/README.md +38 -13
- package/docs/sdks/companyinfo/README.md +2 -2
- package/docs/sdks/connections/README.md +5 -5
- package/docs/sdks/createoperations/README.md +2 -2
- package/docs/sdks/creditnotes/README.md +2 -2
- package/docs/sdks/customers/README.md +5 -5
- package/docs/sdks/dataintegrity/README.md +3 -3
- package/docs/sdks/directcosts/README.md +10 -11
- package/docs/sdks/directincomes/README.md +5 -5
- package/docs/sdks/disputes/README.md +2 -2
- package/docs/sdks/excelreports/README.md +3 -3
- package/docs/sdks/fileupload/README.md +8 -6
- package/docs/sdks/invoices/README.md +7 -7
- package/docs/sdks/journalentries/README.md +2 -2
- package/docs/sdks/journals/README.md +2 -2
- package/docs/sdks/liabilities/README.md +4 -4
- package/docs/sdks/locations/README.md +2 -2
- package/docs/sdks/managedata/README.md +1 -1
- package/docs/sdks/metrics/README.md +3 -3
- package/docs/sdks/orders/README.md +2 -2
- package/docs/sdks/paymentmethods/README.md +2 -2
- package/docs/sdks/payments/README.md +2 -2
- package/docs/sdks/productcategories/README.md +2 -2
- package/docs/sdks/products/README.md +2 -2
- package/docs/sdks/profitandloss/README.md +2 -2
- package/docs/sdks/pulloperations/README.md +2 -2
- package/docs/sdks/refresh/README.md +2 -2
- package/docs/sdks/reports/README.md +4 -4
- package/docs/sdks/suppliers/README.md +5 -5
- package/docs/sdks/transactioncategories/README.md +2 -2
- package/docs/sdks/transfers/README.md +3 -4
- package/package.json +1 -1
- package/docs/sdk/models/shared/accountingdirectcostcontactref.md +0 -11
- package/docs/sdk/models/shared/directcostprototypecontactref.md +0 -11
|
@@ -27,14 +27,792 @@ var __metadata = (this && this.__metadata) || function (k, v) {
|
|
|
27
27
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
28
28
|
};
|
|
29
29
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
-
exports.AccountingCreatePaymentResponse = void 0;
|
|
30
|
+
exports.AccountingCreatePaymentResponse = exports.AccountingCreatePaymentResponseAccountingPayment = void 0;
|
|
31
31
|
var utils_1 = require("../../../internal/utils");
|
|
32
|
-
var
|
|
32
|
+
var accountingcustomerref_1 = require("./accountingcustomerref");
|
|
33
|
+
var accountref_1 = require("./accountref");
|
|
33
34
|
var datatype_1 = require("./datatype");
|
|
35
|
+
var metadata_1 = require("./metadata");
|
|
36
|
+
var paymentline_1 = require("./paymentline");
|
|
37
|
+
var paymentmethodref_1 = require("./paymentmethodref");
|
|
34
38
|
var pushoperationchange_1 = require("./pushoperationchange");
|
|
35
39
|
var pushoperationstatus_1 = require("./pushoperationstatus");
|
|
40
|
+
var supplementaldata_1 = require("./supplementaldata");
|
|
36
41
|
var validation_1 = require("./validation");
|
|
37
42
|
var class_transformer_1 = require("class-transformer");
|
|
43
|
+
/**
|
|
44
|
+
* > **Payments or bill payments?**
|
|
45
|
+
*
|
|
46
|
+
* @remarks
|
|
47
|
+
* >
|
|
48
|
+
* > 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.
|
|
49
|
+
*
|
|
50
|
+
* > 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>.
|
|
51
|
+
*
|
|
52
|
+
* ## Overview
|
|
53
|
+
*
|
|
54
|
+
* 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).
|
|
55
|
+
*
|
|
56
|
+
* A payment in Codat usually represents an allocation of money within any customer accounts receivable account. This includes, but is not strictly limited to:
|
|
57
|
+
*
|
|
58
|
+
* - A payment made against an invoice, like a credit card, cheque, or cash payment.
|
|
59
|
+
* - An allocation of a customer's credit note, either to an invoice or maybe a refund.
|
|
60
|
+
* - 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.
|
|
61
|
+
*
|
|
62
|
+
* Depending on the payments allowed by the underlying accounting package, some payment types may be combined. Please see the example for more details.
|
|
63
|
+
*
|
|
64
|
+
* In Codat, a payment contains details of:
|
|
65
|
+
*
|
|
66
|
+
* - When the payment was recorded in the accounting system.
|
|
67
|
+
* - How much it is for and in what currency that amount is in.
|
|
68
|
+
* - Who the payment was _paid by_ – the _customer_.
|
|
69
|
+
* - The payment method used.
|
|
70
|
+
* - The breakdown of the types of payments – the _line items_.
|
|
71
|
+
*
|
|
72
|
+
* Payments is a child data type of [account transactions](https://docs.codat.io/lending-api#/schemas/AccountTransaction).
|
|
73
|
+
*
|
|
74
|
+
* ## Payment types
|
|
75
|
+
*
|
|
76
|
+
* ## Payment of an invoice
|
|
77
|
+
*
|
|
78
|
+
* A payment paying a single invoice has one entry in its `lines` array. This **line** has the following properties:
|
|
79
|
+
*
|
|
80
|
+
* - An _amount_ that indicates the amount of the invoice that was paid. This is always positive.
|
|
81
|
+
* - A **links** array containing one element with the following properties:
|
|
82
|
+
* - A **type** that indicates the type of **link**, in this case an `Invoice`.
|
|
83
|
+
* - An **id** that contains the ID of the invoice that was paid.
|
|
84
|
+
* - An **amount** for the link. The sum of the **line.amount** and the **links.amount** must equal `0`.
|
|
85
|
+
*
|
|
86
|
+
* The **amount** field on the **line** equals the **totalAmount** on the payment.
|
|
87
|
+
*
|
|
88
|
+
* ## Payment of multiple invoices
|
|
89
|
+
*
|
|
90
|
+
* A single payment can pay multiple invoices. This can be represented in one of two formats depending on how the customer keeps their books:
|
|
91
|
+
*
|
|
92
|
+
* - 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).
|
|
93
|
+
* - 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.
|
|
94
|
+
*
|
|
95
|
+
* 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.
|
|
96
|
+
*
|
|
97
|
+
* ## Payments and refunds on account
|
|
98
|
+
*
|
|
99
|
+
* 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:
|
|
100
|
+
*
|
|
101
|
+
* - 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.
|
|
102
|
+
* - A **links** array containing one element with the following properties:
|
|
103
|
+
* - A **type** that indicates the type of link. For a payment this is `PaymentOnAccount`. For a refund this is `Refund`.
|
|
104
|
+
* - The **id** containing the ID of the customer.
|
|
105
|
+
* - The **amount** for the link is `0` – the **totalAmount** _or_ the amount of the payment or refund.
|
|
106
|
+
*
|
|
107
|
+
* 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.
|
|
108
|
+
*
|
|
109
|
+
* ## Using a credit note to pay an invoice
|
|
110
|
+
*
|
|
111
|
+
* The payment of an invoice using a credit note has one entry in its **lines** array. This **line** has the following properties:
|
|
112
|
+
*
|
|
113
|
+
* - 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.
|
|
114
|
+
* - A **links** array containing two elements:
|
|
115
|
+
* - The first **link** has:
|
|
116
|
+
* - A **type** that indicates the type of **link**, in this case an `Invoice`.
|
|
117
|
+
* - An **id** that contains the ID of the invoice that was paid.
|
|
118
|
+
* - The second **link** has:
|
|
119
|
+
* - A **type** that indicates the type of **link**, in this case a `CreditNote`.
|
|
120
|
+
* - An **id** that contains the ID of the credit note used by this payment.
|
|
121
|
+
*
|
|
122
|
+
* The **amount** field on the **line** equals the **totalAmount** on the payment.
|
|
123
|
+
*
|
|
124
|
+
* ## Refunding a credit note
|
|
125
|
+
*
|
|
126
|
+
* A payment refunding a credit note has one entry in its **lines** array. This **line** has the following properties:
|
|
127
|
+
*
|
|
128
|
+
* - An **amount** that indicates the amount of the credit note that was refunded. This is always negative for a refund.
|
|
129
|
+
* - A **links** array that contains one element with the following properties:
|
|
130
|
+
* - A **type** that indicates the type of **link**, in this case a `CreditNote`.
|
|
131
|
+
* - An **id** that contains the ID of the credit note that was refunded.
|
|
132
|
+
*
|
|
133
|
+
* The **totalAmount** field on the payment equals the **amount** field of the **line**. These are both negative, as this is money leaving accounts receivable.
|
|
134
|
+
*
|
|
135
|
+
* ## Refunding a payment
|
|
136
|
+
*
|
|
137
|
+
* 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:
|
|
138
|
+
*
|
|
139
|
+
* - One for the incoming over payment.
|
|
140
|
+
* - Another for the outgoing refund.
|
|
141
|
+
*
|
|
142
|
+
* The payment issuing the refund has a negative **totalAmount**. This payment also has one entry in its lines array with the following properties:
|
|
143
|
+
*
|
|
144
|
+
* - An **amount** that indicates the amount that was refunded. This is always negative.
|
|
145
|
+
* - A **links** array that contains one element with the following properties:
|
|
146
|
+
* - A **type** that indicates the type of **link**, in this case a `Payment`.
|
|
147
|
+
* - An **id** that contains the ID of the payment that was refunded.
|
|
148
|
+
*
|
|
149
|
+
* The **amount** field on the **line** equals the **totalAmount** on the payment and is negative, as this is money leaving accounts receivable.
|
|
150
|
+
*
|
|
151
|
+
* 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.
|
|
152
|
+
*
|
|
153
|
+
* For example: A £1,050 payment on a £1,000 invoice with a refund of £50 has two lines:
|
|
154
|
+
*
|
|
155
|
+
* - One for £1,000 linked to the invoice that was paid.
|
|
156
|
+
* - Another for £50 linked to the payment that refunded the overpayment with a** type** of `Refund` and an ID that corresponds to the payment.
|
|
157
|
+
*
|
|
158
|
+
* The **line** linked to the payment has the following properties:
|
|
159
|
+
*
|
|
160
|
+
* - 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.
|
|
161
|
+
* - A **links** array containing one element with the following properties:
|
|
162
|
+
* - A **type** that indicates the type of **link**, in this case a `Refund`.
|
|
163
|
+
* - An **id** that contains the ID of the payment that refunded this line.
|
|
164
|
+
*
|
|
165
|
+
* > **Support for linked payments**
|
|
166
|
+
* >
|
|
167
|
+
* > 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.
|
|
168
|
+
*
|
|
169
|
+
* ## Foreign currencies
|
|
170
|
+
*
|
|
171
|
+
* There are two types of currency rate that are included in the payments data type:
|
|
172
|
+
*
|
|
173
|
+
* Payment currency rate:
|
|
174
|
+
*
|
|
175
|
+
* - Base currency of the accounts receivable account.
|
|
176
|
+
* - Foreign currency of the payment.
|
|
177
|
+
*
|
|
178
|
+
* Payment line link currency rate:
|
|
179
|
+
*
|
|
180
|
+
* - Base currency of the item the link represents.
|
|
181
|
+
* - Foreign currency of the payment.
|
|
182
|
+
*
|
|
183
|
+
* 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:
|
|
184
|
+
*
|
|
185
|
+
* - The base currency for the accounts receivable account.
|
|
186
|
+
* - The currency of the item.
|
|
187
|
+
*
|
|
188
|
+
* ```json title="Currency rate example"
|
|
189
|
+
* {
|
|
190
|
+
* "id": "123",
|
|
191
|
+
* "note": "",
|
|
192
|
+
* "totalAmount": 99.99,
|
|
193
|
+
* "currency": "GBP",
|
|
194
|
+
* "lines": [
|
|
195
|
+
* {
|
|
196
|
+
* "amount": 99.99,
|
|
197
|
+
* "links": [
|
|
198
|
+
* {
|
|
199
|
+
* "type": "Invoice",
|
|
200
|
+
* "id": "178",
|
|
201
|
+
* "amount": -50,
|
|
202
|
+
* "currencyRate": 1.9998
|
|
203
|
+
* }
|
|
204
|
+
* ]
|
|
205
|
+
* }
|
|
206
|
+
* ]
|
|
207
|
+
* }
|
|
208
|
+
* ```
|
|
209
|
+
*
|
|
210
|
+
*
|
|
211
|
+
*
|
|
212
|
+
* ## Example data
|
|
213
|
+
*
|
|
214
|
+
* > **Object properties**
|
|
215
|
+
* >
|
|
216
|
+
* > 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).
|
|
217
|
+
*
|
|
218
|
+
* ## Simple examples
|
|
219
|
+
*
|
|
220
|
+
* ```json title="Payment for invoice"
|
|
221
|
+
* {
|
|
222
|
+
* "totalAmount": 1000,
|
|
223
|
+
* "lines": [
|
|
224
|
+
* {
|
|
225
|
+
* "amount" : 1000,
|
|
226
|
+
* "links" : [
|
|
227
|
+
* {
|
|
228
|
+
* "type" : "Invoice",
|
|
229
|
+
* "id" : "x",
|
|
230
|
+
* "amount" : -1000
|
|
231
|
+
* }
|
|
232
|
+
* ]
|
|
233
|
+
* }
|
|
234
|
+
* ]
|
|
235
|
+
* }
|
|
236
|
+
* ```
|
|
237
|
+
*
|
|
238
|
+
*
|
|
239
|
+
*
|
|
240
|
+
* ```json title="Allocation of credit note"
|
|
241
|
+
* {
|
|
242
|
+
* "totalAmount": 0,
|
|
243
|
+
* "lines": [
|
|
244
|
+
* {
|
|
245
|
+
* "amount" : 0,
|
|
246
|
+
* "links" : [
|
|
247
|
+
* {
|
|
248
|
+
* "type" : "Invoice",
|
|
249
|
+
* "id" : "x",
|
|
250
|
+
* "amount" : -1000
|
|
251
|
+
* },
|
|
252
|
+
* {
|
|
253
|
+
* "type" : "CreditNote",
|
|
254
|
+
* "id" : "y",
|
|
255
|
+
* "amount" : 1000
|
|
256
|
+
* }
|
|
257
|
+
* ]
|
|
258
|
+
* }
|
|
259
|
+
* ]
|
|
260
|
+
* }
|
|
261
|
+
* ```
|
|
262
|
+
*
|
|
263
|
+
*
|
|
264
|
+
*
|
|
265
|
+
* ```json title="Payment of invoice and payment on account"
|
|
266
|
+
* {
|
|
267
|
+
* "totalAmount": 2000,
|
|
268
|
+
* "lines": [
|
|
269
|
+
* {
|
|
270
|
+
* "amount" : 1000,
|
|
271
|
+
* "links" : [
|
|
272
|
+
* {
|
|
273
|
+
* "type" : "Invoice",
|
|
274
|
+
* "id" : "x",
|
|
275
|
+
* "amount" : -1000
|
|
276
|
+
* }
|
|
277
|
+
* ]
|
|
278
|
+
* },
|
|
279
|
+
* {
|
|
280
|
+
* "amount" : 1000,
|
|
281
|
+
* "links" : [
|
|
282
|
+
* {
|
|
283
|
+
* "type" : "PaymentOnAccount",
|
|
284
|
+
* "id" : "y",
|
|
285
|
+
* "amount" : -1000
|
|
286
|
+
* }
|
|
287
|
+
* ]
|
|
288
|
+
* }
|
|
289
|
+
* ]
|
|
290
|
+
* }
|
|
291
|
+
* ```
|
|
292
|
+
*
|
|
293
|
+
*
|
|
294
|
+
*
|
|
295
|
+
* ```json title="Refund of credit note"
|
|
296
|
+
* {
|
|
297
|
+
* "totalAmount": -1000,
|
|
298
|
+
* "lines": [
|
|
299
|
+
* {
|
|
300
|
+
* "amount" : -1000,
|
|
301
|
+
* "links" : [
|
|
302
|
+
* {
|
|
303
|
+
* "type" : "CreditNote",
|
|
304
|
+
* "id" : "y",
|
|
305
|
+
* "amount" : 1000
|
|
306
|
+
* }
|
|
307
|
+
* ]
|
|
308
|
+
* }
|
|
309
|
+
* ]
|
|
310
|
+
* }
|
|
311
|
+
* ```
|
|
312
|
+
*
|
|
313
|
+
*
|
|
314
|
+
*
|
|
315
|
+
* ```json title="Refund on accounts receivable account"
|
|
316
|
+
* {
|
|
317
|
+
* "totalAmount": -1000,
|
|
318
|
+
* "lines": [
|
|
319
|
+
* {
|
|
320
|
+
* "amount" : -1000,
|
|
321
|
+
* "links" : [
|
|
322
|
+
* {
|
|
323
|
+
* "type" : "PaymentOnAccount",
|
|
324
|
+
* "id" : "y",
|
|
325
|
+
* "amount" : 1000
|
|
326
|
+
* }
|
|
327
|
+
* ]
|
|
328
|
+
* }
|
|
329
|
+
* ]
|
|
330
|
+
* }
|
|
331
|
+
* ```
|
|
332
|
+
*
|
|
333
|
+
*
|
|
334
|
+
*
|
|
335
|
+
* ```json title="Linked refund on accounts receivable account"
|
|
336
|
+
* {
|
|
337
|
+
* "id" : "payment-001",
|
|
338
|
+
* "totalAmount": 1000,
|
|
339
|
+
* "lines": [
|
|
340
|
+
* {
|
|
341
|
+
* "amount" : 1000,
|
|
342
|
+
* "links" : [
|
|
343
|
+
* {
|
|
344
|
+
* "type" : "Refund",
|
|
345
|
+
* "id" : "refund-001",
|
|
346
|
+
* "amount" : -1000
|
|
347
|
+
* }
|
|
348
|
+
* ]
|
|
349
|
+
* }
|
|
350
|
+
* ]
|
|
351
|
+
* }
|
|
352
|
+
* {
|
|
353
|
+
* "id" : "refund-001",
|
|
354
|
+
* "totalAmount": -1000,
|
|
355
|
+
* "lines": [
|
|
356
|
+
* {
|
|
357
|
+
* "amount" : -1000,
|
|
358
|
+
* "links" : [
|
|
359
|
+
* {
|
|
360
|
+
* "type" : "Payment",
|
|
361
|
+
* "id" : "payment-001",
|
|
362
|
+
* "amount" : 1000
|
|
363
|
+
* }
|
|
364
|
+
* ]
|
|
365
|
+
* }
|
|
366
|
+
* ]
|
|
367
|
+
* }
|
|
368
|
+
* ```
|
|
369
|
+
*
|
|
370
|
+
*
|
|
371
|
+
*
|
|
372
|
+
* ```json title="Using a credit note and cash to pay an invoice"
|
|
373
|
+
* {
|
|
374
|
+
* "totalAmount": 250,
|
|
375
|
+
* "lines": [
|
|
376
|
+
* {
|
|
377
|
+
* "amount": 0,
|
|
378
|
+
* "links": [
|
|
379
|
+
* {
|
|
380
|
+
* "type": "Invoice",
|
|
381
|
+
* "id": "x",
|
|
382
|
+
* "amount": -750
|
|
383
|
+
* },
|
|
384
|
+
* {
|
|
385
|
+
* "type": "CreditNote",
|
|
386
|
+
* "id": "y",
|
|
387
|
+
* "amount": 750
|
|
388
|
+
* }
|
|
389
|
+
* ]
|
|
390
|
+
* },
|
|
391
|
+
* {
|
|
392
|
+
* "amount": 250,
|
|
393
|
+
* "links": [
|
|
394
|
+
* {
|
|
395
|
+
* "type": "Invoice",
|
|
396
|
+
* "id": "x",
|
|
397
|
+
* "amount": -250
|
|
398
|
+
* }
|
|
399
|
+
* ]
|
|
400
|
+
* }
|
|
401
|
+
* ]
|
|
402
|
+
* }
|
|
403
|
+
* ```
|
|
404
|
+
*
|
|
405
|
+
*
|
|
406
|
+
*
|
|
407
|
+
* ## Complex examples
|
|
408
|
+
*
|
|
409
|
+
* ```json title="Use two credit notes and 1000 in to "bank" (cash, cheque etc.) to pay invoice"
|
|
410
|
+
* {
|
|
411
|
+
* "totalAmount": 1000,
|
|
412
|
+
* "lines": [
|
|
413
|
+
* {
|
|
414
|
+
* "amount" : 0,
|
|
415
|
+
* "links" : [
|
|
416
|
+
* {
|
|
417
|
+
* "type" : "Invoice",
|
|
418
|
+
* "id" : "x",
|
|
419
|
+
* "amount" : -1000
|
|
420
|
+
* },
|
|
421
|
+
* {
|
|
422
|
+
* "type" : "CreditNote",
|
|
423
|
+
* "id" : "y",
|
|
424
|
+
* "amount" : 1000
|
|
425
|
+
* }
|
|
426
|
+
* ]
|
|
427
|
+
* },
|
|
428
|
+
* {
|
|
429
|
+
* "amount" : 0,
|
|
430
|
+
* "links" : [
|
|
431
|
+
* {
|
|
432
|
+
* "type" : "Invoice",
|
|
433
|
+
* "id" : "x",
|
|
434
|
+
* "amount" : -1000
|
|
435
|
+
* },
|
|
436
|
+
* {
|
|
437
|
+
* "type" : "CreditNote",
|
|
438
|
+
* "id" : "z",
|
|
439
|
+
* "amount" : 1000
|
|
440
|
+
* }
|
|
441
|
+
* ]
|
|
442
|
+
* },
|
|
443
|
+
* {
|
|
444
|
+
* "amount" : 1000,
|
|
445
|
+
* "links" : [
|
|
446
|
+
* {
|
|
447
|
+
* "type" : "Invoice",
|
|
448
|
+
* "id" : "x",
|
|
449
|
+
* "amount" : -1000
|
|
450
|
+
* }
|
|
451
|
+
* ]
|
|
452
|
+
* }
|
|
453
|
+
* ]
|
|
454
|
+
* }
|
|
455
|
+
* ```
|
|
456
|
+
*
|
|
457
|
+
*
|
|
458
|
+
*
|
|
459
|
+
* ```json title="Pay an invoice with two credit notes and cash, with 1000 left 'on account'"
|
|
460
|
+
* {
|
|
461
|
+
* "totalAmount": 2000,
|
|
462
|
+
* "lines": [
|
|
463
|
+
* {
|
|
464
|
+
* "amount" : 0,
|
|
465
|
+
* "links" : [
|
|
466
|
+
* {
|
|
467
|
+
* "type" : "Invoice",
|
|
468
|
+
* "id" : "x",
|
|
469
|
+
* "amount" : -1000
|
|
470
|
+
* },
|
|
471
|
+
* {
|
|
472
|
+
* "type" : "CreditNote",
|
|
473
|
+
* "id" : "y",
|
|
474
|
+
* "amount" : 1000
|
|
475
|
+
* }
|
|
476
|
+
* ]
|
|
477
|
+
* },
|
|
478
|
+
* {
|
|
479
|
+
* "amount" : 0,
|
|
480
|
+
* "links" : [
|
|
481
|
+
* {
|
|
482
|
+
* "type" : "Invoice",
|
|
483
|
+
* "id" : "x",
|
|
484
|
+
* "amount" : -1000
|
|
485
|
+
* },
|
|
486
|
+
* {
|
|
487
|
+
* "type" : "CreditNote",
|
|
488
|
+
* "id" : "z",
|
|
489
|
+
* "amount" : 1000
|
|
490
|
+
* }
|
|
491
|
+
* ]
|
|
492
|
+
* },
|
|
493
|
+
* {
|
|
494
|
+
* "amount" : 1000,
|
|
495
|
+
* "links" : [
|
|
496
|
+
* {
|
|
497
|
+
* "type" : "Invoice",
|
|
498
|
+
* "id" : "x",
|
|
499
|
+
* "amount" : -1000
|
|
500
|
+
* }
|
|
501
|
+
* ]
|
|
502
|
+
* },
|
|
503
|
+
* {
|
|
504
|
+
* "amount" : 1000,
|
|
505
|
+
* "links" : [
|
|
506
|
+
* {
|
|
507
|
+
* "type" : "PaymentOnAccount",
|
|
508
|
+
* "id" : "customer-001",
|
|
509
|
+
* "amount" : -1000
|
|
510
|
+
* }
|
|
511
|
+
* ]
|
|
512
|
+
* }
|
|
513
|
+
* ]
|
|
514
|
+
* }
|
|
515
|
+
* ```
|
|
516
|
+
*
|
|
517
|
+
*
|
|
518
|
+
*
|
|
519
|
+
* ```json title="Two credit notes pay two invoices with no allocation amount specified"
|
|
520
|
+
* {
|
|
521
|
+
* "totalAmount": 0,
|
|
522
|
+
* "lines": [
|
|
523
|
+
* {
|
|
524
|
+
* "amount" : 0,
|
|
525
|
+
* "links" : [
|
|
526
|
+
* {
|
|
527
|
+
* "type" : "Invoice",
|
|
528
|
+
* "id" : "w",
|
|
529
|
+
* "amount" : -1000
|
|
530
|
+
* },
|
|
531
|
+
* {
|
|
532
|
+
* "type" : "Invoice",
|
|
533
|
+
* "id" : "x",
|
|
534
|
+
* "amount" : -1000
|
|
535
|
+
* },
|
|
536
|
+
* {
|
|
537
|
+
* "type" : "CreditNote",
|
|
538
|
+
* "id" : "y",
|
|
539
|
+
* "amount" : 1000
|
|
540
|
+
* },
|
|
541
|
+
* {
|
|
542
|
+
* "type" : "CreditNote",
|
|
543
|
+
* "id" : "z",
|
|
544
|
+
* "amount" : 1000
|
|
545
|
+
* }
|
|
546
|
+
* ]
|
|
547
|
+
* }
|
|
548
|
+
* ]
|
|
549
|
+
* }
|
|
550
|
+
* ```
|
|
551
|
+
*
|
|
552
|
+
*
|
|
553
|
+
*
|
|
554
|
+
* ```json title="Two credit notes and cash pay three invoices with no allocation amount specified, and refund cash"
|
|
555
|
+
* {
|
|
556
|
+
* "totalAmount": 2000,
|
|
557
|
+
* "lines": [
|
|
558
|
+
* {
|
|
559
|
+
* "amount" : 1000,
|
|
560
|
+
* "links" : [
|
|
561
|
+
* {
|
|
562
|
+
* "type" : "Invoice",
|
|
563
|
+
* "id" : "w",
|
|
564
|
+
* "amount" : -1000
|
|
565
|
+
* },
|
|
566
|
+
* {
|
|
567
|
+
* "type" : "Invoice",
|
|
568
|
+
* "id" : "x",
|
|
569
|
+
* "amount" : -1000
|
|
570
|
+
* },
|
|
571
|
+
* {
|
|
572
|
+
* "type" : "Invoice",
|
|
573
|
+
* "id" : "u",
|
|
574
|
+
* "amount" : -1000
|
|
575
|
+
* },
|
|
576
|
+
* {
|
|
577
|
+
* "type" : "CreditNote",
|
|
578
|
+
* "id" : "y",
|
|
579
|
+
* "amount" : 1000
|
|
580
|
+
* },
|
|
581
|
+
* {
|
|
582
|
+
* "type" : "CreditNote",
|
|
583
|
+
* "id" : "z",
|
|
584
|
+
* "amount" : 1000
|
|
585
|
+
* }
|
|
586
|
+
* ]
|
|
587
|
+
* },
|
|
588
|
+
* {
|
|
589
|
+
* "amount" : 1000,
|
|
590
|
+
* "links" : [
|
|
591
|
+
* {
|
|
592
|
+
* "type" : "Refund",
|
|
593
|
+
* "id" : "refund-001",
|
|
594
|
+
* "amount" : -1000
|
|
595
|
+
* }
|
|
596
|
+
* ]
|
|
597
|
+
* }
|
|
598
|
+
* ]
|
|
599
|
+
* }
|
|
600
|
+
* {
|
|
601
|
+
* "id" : "refund-001",
|
|
602
|
+
* "totalAmount": -1000,
|
|
603
|
+
* "lines": [
|
|
604
|
+
* {
|
|
605
|
+
* "amount" : -1000,
|
|
606
|
+
* "links" : [
|
|
607
|
+
* {
|
|
608
|
+
* "type" : "Payment",
|
|
609
|
+
* "id" : "payment-001",
|
|
610
|
+
* "amount" : 1000
|
|
611
|
+
* }
|
|
612
|
+
* ]
|
|
613
|
+
* }
|
|
614
|
+
* ]
|
|
615
|
+
* }
|
|
616
|
+
* ```
|
|
617
|
+
*
|
|
618
|
+
*
|
|
619
|
+
*
|
|
620
|
+
* In this example, a payment on account is used to pay the same invoice in January and again in February.
|
|
621
|
+
*
|
|
622
|
+
* ```json title="January"
|
|
623
|
+
* {
|
|
624
|
+
* "id": "001",
|
|
625
|
+
* "totalAmount": 5000,
|
|
626
|
+
* "date" : "1901-01-01",
|
|
627
|
+
* "lines": [
|
|
628
|
+
* {
|
|
629
|
+
* "amount" : 1000,
|
|
630
|
+
* "links" : [
|
|
631
|
+
* {
|
|
632
|
+
* "type" : "Invoice",
|
|
633
|
+
* "id" : "Invoice-x",
|
|
634
|
+
* "amount" : -1000
|
|
635
|
+
* }
|
|
636
|
+
* ]
|
|
637
|
+
* },
|
|
638
|
+
* {
|
|
639
|
+
* "amount" : 4000,
|
|
640
|
+
* "links" : [
|
|
641
|
+
* {
|
|
642
|
+
* "type" : "PaymentOnAccount",
|
|
643
|
+
* "id" : "PaymentOnAccount-y",
|
|
644
|
+
* "amount" : -4000
|
|
645
|
+
* }
|
|
646
|
+
* ]
|
|
647
|
+
* }
|
|
648
|
+
* ]
|
|
649
|
+
* }
|
|
650
|
+
* ```
|
|
651
|
+
*
|
|
652
|
+
*
|
|
653
|
+
*
|
|
654
|
+
* ```json title="February"
|
|
655
|
+
* {
|
|
656
|
+
* "id": "001",
|
|
657
|
+
* "totalAmount": 5000,
|
|
658
|
+
* "date" : "1901-02-01",
|
|
659
|
+
* "lines": [
|
|
660
|
+
* {
|
|
661
|
+
* "amount" : 1000,
|
|
662
|
+
* "links" : [
|
|
663
|
+
* {
|
|
664
|
+
* "type" : "Invoice",
|
|
665
|
+
* "id" : "Invoice-x",
|
|
666
|
+
* "amount" : -1000
|
|
667
|
+
* }
|
|
668
|
+
* ]
|
|
669
|
+
* },
|
|
670
|
+
* {
|
|
671
|
+
* "amount" : 1000,
|
|
672
|
+
* "links" : [
|
|
673
|
+
* {
|
|
674
|
+
* "type" : "Invoice",
|
|
675
|
+
* "id" : "Invoice-y",
|
|
676
|
+
* "amount" : -1000
|
|
677
|
+
* }
|
|
678
|
+
* ]
|
|
679
|
+
* },
|
|
680
|
+
* {
|
|
681
|
+
* "amount" : 3000,
|
|
682
|
+
* "links" : [
|
|
683
|
+
* {
|
|
684
|
+
* "type" : "PaymentOnAccount",
|
|
685
|
+
* "id" : "PaymentOnAccount-y",
|
|
686
|
+
* "amount" : -3000
|
|
687
|
+
* }
|
|
688
|
+
* ]
|
|
689
|
+
* }
|
|
690
|
+
* ]
|
|
691
|
+
* }
|
|
692
|
+
* ```
|
|
693
|
+
*
|
|
694
|
+
*
|
|
695
|
+
*
|
|
696
|
+
* ```json title="Two credit notes and some cash pay two invoices with no allocations specified"
|
|
697
|
+
* {
|
|
698
|
+
* "totalAmount": 500,
|
|
699
|
+
* "lines": [
|
|
700
|
+
* {
|
|
701
|
+
* "amount": 500,
|
|
702
|
+
* "links": [{
|
|
703
|
+
* "type": "Invoice",
|
|
704
|
+
* "id": "a",
|
|
705
|
+
* "amount": -1000
|
|
706
|
+
* }, {
|
|
707
|
+
* "type": "Invoice",
|
|
708
|
+
* "id": "b",
|
|
709
|
+
* "amount": -1000
|
|
710
|
+
* }, {
|
|
711
|
+
* "type": "CreditNote",
|
|
712
|
+
* "id": "y",
|
|
713
|
+
* "amount": 750
|
|
714
|
+
* },{
|
|
715
|
+
* "type": "CreditNote",
|
|
716
|
+
* "id": "z",
|
|
717
|
+
* "amount": 750
|
|
718
|
+
* }
|
|
719
|
+
* ]
|
|
720
|
+
* }
|
|
721
|
+
* ]
|
|
722
|
+
* }
|
|
723
|
+
* ```
|
|
724
|
+
*
|
|
725
|
+
* @deprecated class: This will be removed in a future release, please migrate away from it as soon as possible.
|
|
726
|
+
*/
|
|
727
|
+
var AccountingCreatePaymentResponseAccountingPayment = /** @class */ (function (_super) {
|
|
728
|
+
__extends(AccountingCreatePaymentResponseAccountingPayment, _super);
|
|
729
|
+
function AccountingCreatePaymentResponseAccountingPayment() {
|
|
730
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
731
|
+
}
|
|
732
|
+
__decorate([
|
|
733
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
734
|
+
(0, class_transformer_1.Expose)({ name: "accountRef" }),
|
|
735
|
+
(0, class_transformer_1.Type)(function () { return accountref_1.AccountRef; }),
|
|
736
|
+
__metadata("design:type", accountref_1.AccountRef)
|
|
737
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "accountRef", void 0);
|
|
738
|
+
__decorate([
|
|
739
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
740
|
+
(0, class_transformer_1.Expose)({ name: "currency" }),
|
|
741
|
+
__metadata("design:type", String)
|
|
742
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "currency", void 0);
|
|
743
|
+
__decorate([
|
|
744
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
745
|
+
(0, class_transformer_1.Expose)({ name: "currencyRate" }),
|
|
746
|
+
__metadata("design:type", Number)
|
|
747
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "currencyRate", void 0);
|
|
748
|
+
__decorate([
|
|
749
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
750
|
+
(0, class_transformer_1.Expose)({ name: "customerRef" }),
|
|
751
|
+
(0, class_transformer_1.Type)(function () { return accountingcustomerref_1.AccountingCustomerRef; }),
|
|
752
|
+
__metadata("design:type", accountingcustomerref_1.AccountingCustomerRef)
|
|
753
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "customerRef", void 0);
|
|
754
|
+
__decorate([
|
|
755
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
756
|
+
(0, class_transformer_1.Expose)({ name: "date" }),
|
|
757
|
+
__metadata("design:type", String)
|
|
758
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "date", void 0);
|
|
759
|
+
__decorate([
|
|
760
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
761
|
+
(0, class_transformer_1.Expose)({ name: "id" }),
|
|
762
|
+
__metadata("design:type", String)
|
|
763
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "id", void 0);
|
|
764
|
+
__decorate([
|
|
765
|
+
(0, utils_1.SpeakeasyMetadata)({ elemType: paymentline_1.PaymentLine }),
|
|
766
|
+
(0, class_transformer_1.Expose)({ name: "lines" }),
|
|
767
|
+
(0, class_transformer_1.Type)(function () { return paymentline_1.PaymentLine; }),
|
|
768
|
+
__metadata("design:type", Array)
|
|
769
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "lines", void 0);
|
|
770
|
+
__decorate([
|
|
771
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
772
|
+
(0, class_transformer_1.Expose)({ name: "metadata" }),
|
|
773
|
+
(0, class_transformer_1.Type)(function () { return metadata_1.Metadata; }),
|
|
774
|
+
__metadata("design:type", metadata_1.Metadata)
|
|
775
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "metadata", void 0);
|
|
776
|
+
__decorate([
|
|
777
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
778
|
+
(0, class_transformer_1.Expose)({ name: "modifiedDate" }),
|
|
779
|
+
__metadata("design:type", String)
|
|
780
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "modifiedDate", void 0);
|
|
781
|
+
__decorate([
|
|
782
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
783
|
+
(0, class_transformer_1.Expose)({ name: "note" }),
|
|
784
|
+
__metadata("design:type", String)
|
|
785
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "note", void 0);
|
|
786
|
+
__decorate([
|
|
787
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
788
|
+
(0, class_transformer_1.Expose)({ name: "paymentMethodRef" }),
|
|
789
|
+
(0, class_transformer_1.Type)(function () { return paymentmethodref_1.PaymentMethodRef; }),
|
|
790
|
+
__metadata("design:type", paymentmethodref_1.PaymentMethodRef)
|
|
791
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "paymentMethodRef", void 0);
|
|
792
|
+
__decorate([
|
|
793
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
794
|
+
(0, class_transformer_1.Expose)({ name: "reference" }),
|
|
795
|
+
__metadata("design:type", String)
|
|
796
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "reference", void 0);
|
|
797
|
+
__decorate([
|
|
798
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
799
|
+
(0, class_transformer_1.Expose)({ name: "sourceModifiedDate" }),
|
|
800
|
+
__metadata("design:type", String)
|
|
801
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "sourceModifiedDate", void 0);
|
|
802
|
+
__decorate([
|
|
803
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
804
|
+
(0, class_transformer_1.Expose)({ name: "supplementalData" }),
|
|
805
|
+
(0, class_transformer_1.Type)(function () { return supplementaldata_1.SupplementalData; }),
|
|
806
|
+
__metadata("design:type", supplementaldata_1.SupplementalData)
|
|
807
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "supplementalData", void 0);
|
|
808
|
+
__decorate([
|
|
809
|
+
(0, utils_1.SpeakeasyMetadata)(),
|
|
810
|
+
(0, class_transformer_1.Expose)({ name: "totalAmount" }),
|
|
811
|
+
__metadata("design:type", Number)
|
|
812
|
+
], AccountingCreatePaymentResponseAccountingPayment.prototype, "totalAmount", void 0);
|
|
813
|
+
return AccountingCreatePaymentResponseAccountingPayment;
|
|
814
|
+
}(utils_1.SpeakeasyBase));
|
|
815
|
+
exports.AccountingCreatePaymentResponseAccountingPayment = AccountingCreatePaymentResponseAccountingPayment;
|
|
38
816
|
var AccountingCreatePaymentResponse = /** @class */ (function (_super) {
|
|
39
817
|
__extends(AccountingCreatePaymentResponse, _super);
|
|
40
818
|
function AccountingCreatePaymentResponse() {
|
|
@@ -59,8 +837,8 @@ var AccountingCreatePaymentResponse = /** @class */ (function (_super) {
|
|
|
59
837
|
__decorate([
|
|
60
838
|
(0, utils_1.SpeakeasyMetadata)(),
|
|
61
839
|
(0, class_transformer_1.Expose)({ name: "data" }),
|
|
62
|
-
(0, class_transformer_1.Type)(function () { return
|
|
63
|
-
__metadata("design:type",
|
|
840
|
+
(0, class_transformer_1.Type)(function () { return AccountingCreatePaymentResponseAccountingPayment; }),
|
|
841
|
+
__metadata("design:type", AccountingCreatePaymentResponseAccountingPayment)
|
|
64
842
|
], AccountingCreatePaymentResponse.prototype, "data", void 0);
|
|
65
843
|
__decorate([
|
|
66
844
|
(0, utils_1.SpeakeasyMetadata)(),
|