diff --git a/components/quickbooks/actions/create-invoice/create-invoice.mjs b/components/quickbooks/actions/create-invoice/create-invoice.mjs index 6250b6fada4bb..2553e95db81bf 100644 --- a/components/quickbooks/actions/create-invoice/create-invoice.mjs +++ b/components/quickbooks/actions/create-invoice/create-invoice.mjs @@ -6,7 +6,7 @@ export default { key: "quickbooks-create-invoice", name: "Create Invoice", description: "Creates an invoice. [See the documentation](https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/invoice#create-an-invoice)", - version: "0.2.0", + version: "0.2.1", type: "action", props: { quickbooks, @@ -16,11 +16,11 @@ export default { "customer", ], }, - currencyRefValue: { - propDefinition: [ - quickbooks, - "currency", - ], + billEmail: { + type: "string", + label: "Bill Email", + description: "Email address where the invoice should be sent", + optional: true, }, dueDate: { type: "string", @@ -28,12 +28,24 @@ export default { description: "Date when the payment of the transaction is due (YYYY-MM-DD)", optional: true, }, - includeInvoiceLink: { + allowOnlineCreditCardPayment: { type: "boolean", - label: "Include Invoice Link", - description: "Return the sharable link for the invoice sent to external customers", + label: "Allow Online Credit Card Payment", + description: "Allow online credit card payment", optional: true, }, + allowOnlineACHPayment: { + type: "boolean", + label: "Allow Online Bank Transfer Payment", + description: "Allow online bank transfer payment", + optional: true, + }, + currencyRefValue: { + propDefinition: [ + quickbooks, + "currency", + ], + }, lineItemsAsObjects: { propDefinition: [ quickbooks, @@ -117,23 +129,33 @@ export default { } }); + const params = {}; + const data = { + Line: lines, + CustomerRef: { + value: this.customerRefValue, + }, + DueDate: this.dueDate, + AllowOnlineCreditCardPayment: this.allowOnlineCreditCardPayment, + AllowOnlineACHPayment: this.allowOnlineACHPayment, + }; + + if (this.billEmail) { + params.include = "invoiceLink"; + data.BillEmail = { + Address: this.billEmail, + }; + } + if (this.currencyRefValue) { + data.CurrencyRef = { + value: this.currencyRefValue, + }; + } + const response = await this.quickbooks.createInvoice({ $, - params: { - include: this.includeInvoiceLink - ? "invoiceLink" - : undefined, - }, - data: { - Line: lines, - DueDate: this.dueDate, - CustomerRef: { - value: this.customerRefValue, - }, - CurrencyRef: { - value: this.currencyRefValue, - }, - }, + params, + data, }); if (response) { diff --git a/components/quickbooks/package.json b/components/quickbooks/package.json index 19a5341d64eb9..ae9f89d260878 100644 --- a/components/quickbooks/package.json +++ b/components/quickbooks/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/quickbooks", - "version": "0.5.2", + "version": "0.5.3", "description": "Pipedream Quickbooks Components", "main": "quickbooks.app.mjs", "keywords": [