diff --git a/components/sage_intacct/actions/create-bill/create-bill.mjs b/components/sage_intacct/actions/create-bill/create-bill.mjs new file mode 100644 index 0000000000000..20b1fe52bfd86 --- /dev/null +++ b/components/sage_intacct/actions/create-bill/create-bill.mjs @@ -0,0 +1,152 @@ +import app from "../../sage_intacct.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "sage_intacct-create-bill", + name: "Create Bill", + description: "Creates a new bill. After you create a bill, it can be moved through the normal Accounts Payable workflow. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/create-accounts-payable-bill)", + version: "0.0.1", + annotations: { + readOnlyHint: false, + openWorldHint: true, + destructiveHint: false, + }, + type: "action", + props: { + app, + billNumber: { + propDefinition: [ + app, + "billNumber", + ], + }, + vendorId: { + propDefinition: [ + app, + "vendorId", + ], + }, + referenceNumber: { + propDefinition: [ + app, + "referenceNumber", + ], + }, + description: { + propDefinition: [ + app, + "description", + ], + }, + createdDate: { + propDefinition: [ + app, + "createdDate", + ], + }, + postingDate: { + propDefinition: [ + app, + "postingDate", + ], + }, + dueDate: { + propDefinition: [ + app, + "dueDate", + ], + }, + discountCutOffDate: { + propDefinition: [ + app, + "discountCutOffDate", + ], + }, + recommendedPaymentDate: { + propDefinition: [ + app, + "recommendedPaymentDate", + ], + }, + paymentPriority: { + propDefinition: [ + app, + "paymentPriority", + ], + }, + isOnHold: { + propDefinition: [ + app, + "isOnHold", + ], + }, + isTaxInclusive: { + propDefinition: [ + app, + "isTaxInclusive", + ], + }, + txnCurrency: { + propDefinition: [ + app, + "txnCurrency", + ], + }, + lines: { + propDefinition: [ + app, + "lines", + ], + }, + }, + async run({ $ }) { + const { + app, + billNumber, + vendorId, + referenceNumber, + description, + createdDate, + postingDate, + dueDate, + discountCutOffDate, + recommendedPaymentDate, + paymentPriority, + isOnHold, + isTaxInclusive, + txnCurrency, + lines, + } = this; + + const response = await app.createBill({ + $, + data: { + billNumber, + referenceNumber, + description, + postingDate, + discountCutOffDate, + recommendedPaymentDate, + paymentPriority, + isOnHold, + isTaxInclusive, + createdDate, + dueDate, + ...(vendorId && { + vendor: { + id: vendorId, + }, + }), + ...(txnCurrency && { + currency: { + txnCurrency, + }, + }), + lines: utils.parseJson(lines), + }, + }); + + $.export("$summary", "Successfully created bill"); + return response; + }, +}; diff --git a/components/sage_intacct/actions/create-vendor/create-vendor.mjs b/components/sage_intacct/actions/create-vendor/create-vendor.mjs new file mode 100644 index 0000000000000..570581f0833cd --- /dev/null +++ b/components/sage_intacct/actions/create-vendor/create-vendor.mjs @@ -0,0 +1,127 @@ +import app from "../../sage_intacct.app.mjs"; + +export default { + key: "sage_intacct-create-vendor", + name: "Create Vendor", + description: "Creates a new vendor. When you add a new vendor, you can provide key descriptive information about that vendor and establish how you want to pay them. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/vendors/tags/accounts_payable_vendors/paths/create-accounts-payable-vendor)", + version: "0.0.1", + type: "action", + annotations: { + readOnlyHint: false, + openWorldHint: true, + destructiveHint: false, + }, + props: { + app, + vendorId: { + propDefinition: [ + app, + "vendorId", + ], + }, + name: { + propDefinition: [ + app, + "vendorName", + ], + }, + taxId: { + propDefinition: [ + app, + "vendorTaxId", + ], + }, + creditLimit: { + propDefinition: [ + app, + "vendorCreditLimit", + ], + }, + billingType: { + propDefinition: [ + app, + "vendorBillingType", + ], + }, + paymentPriority: { + propDefinition: [ + app, + "vendorPaymentPriority", + ], + }, + status: { + propDefinition: [ + app, + "vendorStatus", + ], + }, + isOnHold: { + propDefinition: [ + app, + "vendorIsOnHold", + ], + }, + doNotPay: { + propDefinition: [ + app, + "vendorDoNotPay", + ], + }, + notes: { + propDefinition: [ + app, + "vendorNotes", + ], + }, + vendorAccountNumber: { + propDefinition: [ + app, + "vendorAccountNumber", + ], + }, + preferredPaymentMethod: { + propDefinition: [ + app, + "vendorPreferredPaymentMethod", + ], + }, + }, + async run({ $ }) { + const { + app, + vendorId, + name, + taxId, + creditLimit, + billingType, + paymentPriority, + status, + isOnHold, + doNotPay, + notes, + vendorAccountNumber, + preferredPaymentMethod, + } = this; + + const response = await app.createVendor({ + $, + data: { + id: vendorId, + name, + taxId, + creditLimit, + billingType, + paymentPriority, + status, + isOnHold, + doNotPay, + notes, + vendorAccountNumber, + preferredPaymentMethod, + }, + }); + + $.export("$summary", "Successfully created vendor"); + return response; + }, +}; diff --git a/components/sage_intacct/actions/delete-bill/delete-bill.mjs b/components/sage_intacct/actions/delete-bill/delete-bill.mjs new file mode 100644 index 0000000000000..970aed1e6fda5 --- /dev/null +++ b/components/sage_intacct/actions/delete-bill/delete-bill.mjs @@ -0,0 +1,39 @@ +import app from "../../sage_intacct.app.mjs"; + +export default { + key: "sage_intacct-delete-bill", + name: "Delete Bill", + description: "Deletes a bill. You can only delete unpaid bills that are in a Posted, Draft, or Declined state. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/delete-accounts-payable-bill-key)", + version: "0.0.1", + annotations: { + readOnlyHint: false, + openWorldHint: true, + destructiveHint: true, + }, + type: "action", + props: { + app, + billKey: { + propDefinition: [ + app, + "billKey", + ], + }, + }, + async run({ $ }) { + const { + app, + billKey, + } = this; + + await app.deleteBill({ + $, + billKey, + }); + + $.export("$summary", "Successfully deleted bill"); + return { + success: true, + }; + }, +}; diff --git a/components/sage_intacct/actions/delete-vendor/delete-vendor.mjs b/components/sage_intacct/actions/delete-vendor/delete-vendor.mjs new file mode 100644 index 0000000000000..26b7d18bbed31 --- /dev/null +++ b/components/sage_intacct/actions/delete-vendor/delete-vendor.mjs @@ -0,0 +1,39 @@ +import app from "../../sage_intacct.app.mjs"; + +export default { + key: "sage_intacct-delete-vendor", + name: "Delete Vendor", + description: "Deletes a vendor. You can only delete vendors that aren't tied to any transactions or payments. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/vendors/tags/accounts_payable_vendors/paths/delete-accounts-payable-vendor-key)", + version: "0.0.1", + type: "action", + annotations: { + readOnlyHint: false, + openWorldHint: true, + destructiveHint: true, + }, + props: { + app, + vendorKey: { + propDefinition: [ + app, + "vendorKey", + ], + }, + }, + async run({ $ }) { + const { + app, + vendorKey, + } = this; + + await app.deleteVendor({ + $, + vendorKey, + }); + + $.export("$summary", "Successfully deleted vendor"); + return { + success: true, + }; + }, +}; diff --git a/components/sage_intacct/actions/list-bills/list-bills.mjs b/components/sage_intacct/actions/list-bills/list-bills.mjs new file mode 100644 index 0000000000000..2c9ce5194ab52 --- /dev/null +++ b/components/sage_intacct/actions/list-bills/list-bills.mjs @@ -0,0 +1,27 @@ +import app from "../../sage_intacct.app.mjs"; + +export default { + key: "sage_intacct-list-bills", + name: "List Bills", + description: "Returns up to 100 object references from the collection with a key, ID, and link for each bill. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/list-accounts-payable-bill)", + version: "0.0.1", + type: "action", + annotations: { + readOnlyHint: true, + openWorldHint: true, + destructiveHint: false, + }, + props: { + app, + }, + async run({ $ }) { + const { app } = this; + + const response = await app.listBills({ + $, + }); + + $.export("$summary", "Successfully listed bills"); + return response; + }, +}; diff --git a/components/sage_intacct/actions/list-vendors/list-vendors.mjs b/components/sage_intacct/actions/list-vendors/list-vendors.mjs new file mode 100644 index 0000000000000..85ba0ce93c0f1 --- /dev/null +++ b/components/sage_intacct/actions/list-vendors/list-vendors.mjs @@ -0,0 +1,27 @@ +import app from "../../sage_intacct.app.mjs"; + +export default { + key: "sage_intacct-list-vendors", + name: "List Vendors", + description: "Returns a collection with a key, ID, and link for each vendor. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/vendors/tags/accounts_payable_vendors/paths/list-accounts-payable-vendor)", + version: "0.0.1", + annotations: { + readOnlyHint: true, + openWorldHint: true, + destructiveHint: false, + }, + type: "action", + props: { + app, + }, + async run({ $ }) { + const { app } = this; + + const response = await app.listVendors({ + $, + }); + + $.export("$summary", "Successfully listed vendors"); + return response; + }, +}; diff --git a/components/sage_intacct/actions/update-bill/update-bill.mjs b/components/sage_intacct/actions/update-bill/update-bill.mjs new file mode 100644 index 0000000000000..83a6803d96787 --- /dev/null +++ b/components/sage_intacct/actions/update-bill/update-bill.mjs @@ -0,0 +1,129 @@ +import app from "../../sage_intacct.app.mjs"; +import utils from "../../common/utils.mjs"; + +export default { + key: "sage_intacct-update-bill", + name: "Update Bill", + description: "Updates an existing bill by setting field values. Any fields not provided remain unchanged. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/bills/tags/accounts_payable_bills/paths/update-accounts-payable-bill-key)", + version: "0.0.1", + annotations: { + readOnlyHint: false, + openWorldHint: true, + destructiveHint: true, + }, + type: "action", + props: { + app, + billKey: { + propDefinition: [ + app, + "billKey", + ], + }, + billNumber: { + propDefinition: [ + app, + "billNumber", + ], + }, + referenceNumber: { + propDefinition: [ + app, + "referenceNumber", + ], + }, + description: { + propDefinition: [ + app, + "description", + ], + }, + postingDate: { + propDefinition: [ + app, + "postingDate", + ], + }, + dueDate: { + optional: true, + propDefinition: [ + app, + "dueDate", + ], + }, + discountCutOffDate: { + propDefinition: [ + app, + "discountCutOffDate", + ], + }, + recommendedPaymentDate: { + propDefinition: [ + app, + "recommendedPaymentDate", + ], + }, + paymentPriority: { + propDefinition: [ + app, + "paymentPriority", + ], + }, + isOnHold: { + propDefinition: [ + app, + "isOnHold", + ], + }, + isTaxInclusive: { + propDefinition: [ + app, + "isTaxInclusive", + ], + }, + lines: { + propDefinition: [ + app, + "lines", + ], + }, + }, + async run({ $ }) { + const { + app, + billKey, + billNumber, + referenceNumber, + description, + postingDate, + dueDate, + discountCutOffDate, + recommendedPaymentDate, + paymentPriority, + isOnHold, + isTaxInclusive, + lines, + } = this; + + const response = await app.updateBill({ + $, + billKey, + data: { + billNumber, + referenceNumber, + description, + postingDate, + dueDate, + discountCutOffDate, + recommendedPaymentDate, + paymentPriority, + isOnHold, + isTaxInclusive, + lines: utils.parseJson(lines), + }, + }); + + $.export("$summary", "Successfully updated bill"); + return response; + }, +}; diff --git a/components/sage_intacct/actions/update-vendor/update-vendor.mjs b/components/sage_intacct/actions/update-vendor/update-vendor.mjs new file mode 100644 index 0000000000000..825a361281618 --- /dev/null +++ b/components/sage_intacct/actions/update-vendor/update-vendor.mjs @@ -0,0 +1,136 @@ +import app from "../../sage_intacct.app.mjs"; + +export default { + key: "sage_intacct-update-vendor", + name: "Update Vendor", + description: "Updates an existing vendor by setting field values. Any fields not provided remain unchanged. [See the documentation](https://developer.sage.com/intacct/apis/intacct/1/intacct-openapi/groups/accounts-payable/groups/vendors/tags/accounts_payable_vendors/paths/update-accounts-payable-vendor-key)", + version: "0.0.1", + type: "action", + annotations: { + readOnlyHint: false, + openWorldHint: true, + destructiveHint: false, + }, + props: { + app, + vendorKey: { + propDefinition: [ + app, + "vendorKey", + ], + }, + name: { + optional: true, + propDefinition: [ + app, + "vendorName", + ], + }, + taxId: { + propDefinition: [ + app, + "vendorTaxId", + ], + }, + creditLimit: { + propDefinition: [ + app, + "vendorCreditLimit", + ], + }, + billingType: { + propDefinition: [ + app, + "vendorBillingType", + ], + }, + paymentPriority: { + propDefinition: [ + app, + "vendorPaymentPriority", + ], + }, + status: { + propDefinition: [ + app, + "vendorStatus", + ], + }, + isOnHold: { + propDefinition: [ + app, + "vendorIsOnHold", + ], + }, + doNotPay: { + propDefinition: [ + app, + "vendorDoNotPay", + ], + }, + notes: { + propDefinition: [ + app, + "vendorNotes", + ], + }, + vendorAccountNumber: { + propDefinition: [ + app, + "vendorAccountNumber", + ], + }, + preferredPaymentMethod: { + propDefinition: [ + app, + "vendorPreferredPaymentMethod", + ], + }, + discountPercent: { + propDefinition: [ + app, + "vendorDiscountPercent", + ], + }, + }, + async run({ $ }) { + const { + app, + vendorKey, + name, + taxId, + creditLimit, + billingType, + paymentPriority, + status, + isOnHold, + doNotPay, + notes, + vendorAccountNumber, + preferredPaymentMethod, + discountPercent, + } = this; + + const response = await app.updateVendor({ + $, + vendorKey, + data: { + name, + taxId, + creditLimit, + billingType, + paymentPriority, + status, + isOnHold, + doNotPay, + notes, + vendorAccountNumber, + preferredPaymentMethod, + discountPercent, + }, + }); + + $.export("$summary", "Successfully updated vendor"); + return response; + }, +}; diff --git a/components/sage_intacct/common/utils.mjs b/components/sage_intacct/common/utils.mjs new file mode 100644 index 0000000000000..2adf04343104f --- /dev/null +++ b/components/sage_intacct/common/utils.mjs @@ -0,0 +1,44 @@ +const parseJson = (input, maxDepth = 100) => { + const seen = new WeakSet(); + const parse = (value) => { + if (maxDepth <= 0) { + return value; + } + if (typeof(value) === "string") { + // Only parse if the string looks like a JSON object or array + const trimmed = value.trim(); + if ( + (trimmed.startsWith("{") && trimmed.endsWith("}")) || + (trimmed.startsWith("[") && trimmed.endsWith("]")) + ) { + try { + return parseJson(JSON.parse(value), maxDepth - 1); + } catch (e) { + return value; + } + } + return value; + } else if (typeof(value) === "object" && value !== null && !Array.isArray(value)) { + if (seen.has(value)) { + return value; + } + seen.add(value); + return Object.entries(value) + .reduce((acc, [ + key, + val, + ]) => Object.assign(acc, { + [key]: parse(val), + }), {}); + } else if (Array.isArray(value)) { + return value.map((item) => parse(item)); + } + return value; + }; + + return parse(input); +}; + +export default { + parseJson, +}; diff --git a/components/sage_intacct/package.json b/components/sage_intacct/package.json index 033a1090b095c..0b92bb0c10011 100644 --- a/components/sage_intacct/package.json +++ b/components/sage_intacct/package.json @@ -1,6 +1,6 @@ { "name": "@pipedream/sage_intacct", - "version": "0.0.1", + "version": "0.1.0", "description": "Pipedream Sage Intacct Components", "main": "sage_intacct.app.mjs", "keywords": [ @@ -12,4 +12,4 @@ "publishConfig": { "access": "public" } -} \ No newline at end of file +} diff --git a/components/sage_intacct/sage_intacct.app.mjs b/components/sage_intacct/sage_intacct.app.mjs index c7678017ff969..90b3bece5546b 100644 --- a/components/sage_intacct/sage_intacct.app.mjs +++ b/components/sage_intacct/sage_intacct.app.mjs @@ -1,11 +1,387 @@ +import { axios } from "@pipedream/platform"; + export default { type: "app", app: "sage_intacct", - propDefinitions: {}, + propDefinitions: { + billKey: { + type: "string", + label: "Bill Key", + description: "System-assigned unique key for the bill", + async options({ prevContext: { offset = 0 } }) { + const DEFAULT_LIMIT = 100; + if (offset === null) { + return []; + } + const { data: { "ia::result": bills } } = await this.listBills({ + params: { + offset, + }, + }); + const options = bills.map(({ + key: value, + id: label, + }) => ({ + label, + value, + })); + return { + options, + context: { + offset: bills.length === DEFAULT_LIMIT + ? offset + DEFAULT_LIMIT + : null, + }, + }; + }, + }, + vendorKey: { + type: "string", + label: "Vendor Key", + description: "System-assigned unique key for the vendor", + async options({ prevContext: { offset = 0 } }) { + const DEFAULT_LIMIT = 100; + if (offset === null) { + return []; + } + const { data: { "ia::result": vendors } } = await this.listVendors({ + params: { + offset, + }, + }); + const options = vendors.map(({ + key: value, + id: label, + }) => ({ + label, + value, + })); + return { + options, + context: { + offset: vendors.length === DEFAULT_LIMIT + ? offset + DEFAULT_LIMIT + : null, + }, + }; + }, + }, + billNumber: { + type: "string", + label: "Bill Number", + description: "Vendor-assigned identifier for the bill. You must specify a bill number when creating a bill unless document sequencing is configured.", + optional: true, + }, + vendorId: { + type: "string", + label: "Vendor ID", + description: "Unique identifier of the vendor.", + optional: true, + }, + referenceNumber: { + type: "string", + label: "Reference Number", + description: "A number such as a purchase order or account number that might be useful in searches or reports.", + optional: true, + }, + description: { + type: "string", + label: "Description", + description: "Additional information about the bill.", + optional: true, + }, + createdDate: { + type: "string", + label: "Created Date", + description: "Date the bill was created (YYYY-MM-DD format). Example: `2025-01-01`.", + }, + postingDate: { + type: "string", + label: "Posting Date", + description: "GL Posting date of the bill (YYYY-MM-DD format). Example: `2025-01-01`.", + optional: true, + }, + dueDate: { + type: "string", + label: "Due Date", + description: "Due date for the bill (YYYY-MM-DD format). Example: `2025-01-01`.", + }, + discountCutOffDate: { + type: "string", + label: "Discount Cut Off Date", + description: "Date after which the discount for the bill is no longer valid (YYYY-MM-DD format). Example: `2025-01-01`.", + optional: true, + }, + recommendedPaymentDate: { + type: "string", + label: "Recommended Payment Date", + description: "Recommended payment date for the bill (YYYY-MM-DD format). Example: `2025-01-01`.", + optional: true, + }, + paymentPriority: { + type: "string", + label: "Payment Priority", + description: "The payment priority for this bill.", + options: [ + "urgent", + "high", + "normal", + "low", + ], + optional: true, + }, + isOnHold: { + type: "boolean", + label: "Is On Hold", + description: "Set to true to place this bill on hold.", + optional: true, + }, + isTaxInclusive: { + type: "boolean", + label: "Is Tax Inclusive", + description: "Set to true if bill amounts already include taxes.", + optional: true, + }, + txnCurrency: { + type: "string", + label: "Transaction Currency", + description: "The transaction currency to use for this bill.", + optional: true, + }, + lines: { + type: "object", + label: "Line Items", + description: `Array of line items for the bill. Each item must include: + +**Optional fields:** +- \`totalTxnAmount\`: The total transaction amount for the line item. +- \`memo\`: The memo for the line item. +- \`dimensions\`: The dimensions for the line item. + +**Example:** +\`\`\`json +[ + { + "glAccount": { "id": "6000" }, + "txnAmount": "100.00", + "totalTxnAmount": "100.00", + "memo": "Service charges", + "dimensions": { + "location": { "id": "4" }, + "department": { "id": "11" }, + "project": { "id": "8" }, + "customer": { "id": "1" }, + } + } +] +\`\`\` +`, + }, + vendorName: { + type: "string", + label: "Name", + description: "Name of the vendor.", + }, + vendorTaxId: { + type: "string", + label: "Tax ID", + description: "Tax identification number of the vendor.", + optional: true, + }, + vendorCreditLimit: { + type: "integer", + label: "Credit Limit", + description: "Credit limit for the vendor.", + optional: true, + }, + vendorBillingType: { + type: "string", + label: "Billing Type", + description: "Type of billing for the vendor.", + options: [ + "openItem", + "balanceForward", + ], + optional: true, + }, + vendorPaymentPriority: { + type: "string", + label: "Payment Priority", + description: "The payment priority for this vendor.", + options: [ + "urgent", + "high", + "normal", + "low", + ], + optional: true, + }, + vendorStatus: { + type: "string", + label: "Status", + description: "Status of the vendor.", + options: [ + "active", + "inactive", + ], + optional: true, + }, + vendorIsOnHold: { + type: "boolean", + label: "Is On Hold", + description: "Set to true to put the vendor on hold.", + optional: true, + }, + vendorDoNotPay: { + type: "boolean", + label: "Do Not Pay", + description: "Set to true to prevent payment to this vendor.", + optional: true, + }, + vendorNotes: { + type: "string", + label: "Notes", + description: "Notes about the vendor.", + optional: true, + }, + vendorAccountNumber: { + type: "string", + label: "Vendor Account Number", + description: "Account number that the vendor assigned to your company.", + optional: true, + }, + vendorPreferredPaymentMethod: { + type: "string", + label: "Preferred Payment Method", + description: "Preferred payment method for the vendor.", + options: [ + "printedCheck", + "ach", + "wireTransfer", + ], + optional: true, + }, + vendorDiscountPercent: { + type: "integer", + label: "Discount Percent", + description: "Discount percentage for the vendor.", + optional: true, + }, + }, methods: { - // this.$auth contains connected account data - authKeys() { - console.log(Object.keys(this.$auth)); + getUrl(path) { + return `https://api.intacct.com/ia/api/v1${path}`; + }, + getHeaders(headers) { + return { + ...headers, + "Authorization": `Bearer ${this.$auth.oauth_token}`, + }; + }, + _makeRequest({ + $ = this, path, headers, ...args + } = {}) { + return axios($, { + ...args, + url: this.getUrl(path), + headers: this.getHeaders(headers), + }); + }, + get(args = {}) { + return this._makeRequest({ + ...args, + method: "GET", + }); + }, + post(args = {}) { + return this._makeRequest({ + ...args, + method: "POST", + }); + }, + patch(args = {}) { + return this._makeRequest({ + ...args, + method: "PATCH", + }); + }, + delete(args = {}) { + return this._makeRequest({ + ...args, + method: "DELETE", + }); + }, + listBills(args = {}) { + return this.get({ + path: "/objects/accounts-payable/bill", + ...args, + }); + }, + getBill({ + billKey, ...args + } = {}) { + return this.get({ + path: `/objects/accounts-payable/bill/${billKey}`, + ...args, + }); + }, + createBill(args = {}) { + return this.post({ + path: "/objects/accounts-payable/bill", + ...args, + }); + }, + updateBill({ + billKey, ...args + } = {}) { + return this.patch({ + path: `/objects/accounts-payable/bill/${billKey}`, + ...args, + }); + }, + deleteBill({ + billKey, ...args + } = {}) { + return this.delete({ + path: `/objects/accounts-payable/bill/${billKey}`, + ...args, + }); + }, + listVendors(args = {}) { + return this.get({ + path: "/objects/accounts-payable/vendor", + ...args, + }); + }, + getVendor({ + vendorKey, ...args + } = {}) { + return this.get({ + path: `/objects/accounts-payable/vendor/${vendorKey}`, + ...args, + }); + }, + createVendor(args = {}) { + return this.post({ + path: "/objects/accounts-payable/vendor", + ...args, + }); + }, + updateVendor({ + vendorKey, ...args + } = {}) { + return this.patch({ + path: `/objects/accounts-payable/vendor/${vendorKey}`, + ...args, + }); + }, + deleteVendor({ + vendorKey, ...args + } = {}) { + return this.delete({ + path: `/objects/accounts-payable/vendor/${vendorKey}`, + ...args, + }); }, }, };