2022-08-17 08:50:24 -07:00
import { INodeProperties } from 'n8n-workflow' ;
2020-07-12 09:12:32 -07:00
2021-12-03 00:44:16 -08:00
export const invoiceOperations : INodeProperties [ ] = [
2020-07-12 09:12:32 -07:00
{
displayName : 'Operation' ,
name : 'operation' ,
type : 'options' ,
2022-05-20 14:47:24 -07:00
noDataExpression : true ,
2020-07-12 09:12:32 -07:00
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
options : [
{
name : 'Create' ,
value : 'create' ,
description : 'Create a invoice' ,
2022-07-10 13:50:51 -07:00
action : 'Create an invoice' ,
2020-07-12 09:12:32 -07:00
} ,
{
name : 'Get' ,
value : 'get' ,
description : 'Get a invoice' ,
2022-07-10 13:50:51 -07:00
action : 'Get an invoice' ,
2020-07-12 09:12:32 -07:00
} ,
{
2022-09-07 07:51:14 -07:00
name : 'Get Many' ,
2020-07-12 09:12:32 -07:00
value : 'getAll' ,
2022-09-13 03:36:36 -07:00
description : 'Get many invoices' ,
2022-09-08 08:10:13 -07:00
action : 'Get many invoices' ,
2020-07-12 09:12:32 -07:00
} ,
{
name : 'Update' ,
value : 'update' ,
description : 'Update a invoice' ,
2022-07-10 13:50:51 -07:00
action : 'Update an invoice' ,
2020-07-12 09:12:32 -07:00
} ,
] ,
default : 'create' ,
} ,
2021-12-03 00:44:16 -08:00
] ;
2020-07-12 09:12:32 -07:00
2021-12-03 00:44:16 -08:00
export const invoiceFields : INodeProperties [ ] = [
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* invoice:create */
/* -------------------------------------------------------------------------- */
2020-07-12 09:12:32 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Organization Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'organizationId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getTenants' ,
} ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'create' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Type' ,
name : 'type' ,
type : 'options' ,
options : [
{
name : 'Bill' ,
value : 'ACCPAY' ,
2020-10-22 06:46:03 -07:00
description : 'Accounts Payable or supplier invoice' ,
2020-07-12 09:12:32 -07:00
} ,
{
name : 'Sales Invoice' ,
value : 'ACCREC' ,
2022-05-06 14:01:25 -07:00
description : 'Accounts Receivable or customer invoice' ,
2020-07-12 09:12:32 -07:00
} ,
] ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'create' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
required : true ,
description : 'Invoice Type' ,
} ,
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'create' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Line Items' ,
name : 'lineItemsUi' ,
placeholder : 'Add Line Item' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-07-12 09:12:32 -07:00
typeOptions : {
multipleValues : true ,
} ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'create' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
description : 'Line item data' ,
options : [
{
name : 'lineItemsValues' ,
displayName : 'Line Item' ,
values : [
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
description : 'A line item with just a description' ,
} ,
{
displayName : 'Quantity' ,
name : 'quantity' ,
type : 'number' ,
default : 1 ,
typeOptions : {
minValue : 1 ,
} ,
description : 'LineItem Quantity' ,
} ,
{
displayName : 'Unit Amount' ,
name : 'unitAmount' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Lineitem unit amount. By default, unit amount will be rounded to two decimal places.' ,
2020-07-12 09:12:32 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Item Code Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'itemCode' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getItemCodes' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Account Code Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'accountCode' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getAccountCodes' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
displayName : 'Tax Type' ,
name : 'taxType' ,
type : 'options' ,
options : [
{
name : 'Tax on Purchases' ,
value : 'INPUT' ,
} ,
{
name : 'Tax Exempt' ,
value : 'NONE' ,
} ,
{
name : 'Tax on Sales' ,
value : 'OUTPUT' ,
} ,
{
2022-05-20 14:47:24 -07:00
name : 'Sales Tax on Imports' ,
2020-07-12 09:12:32 -07:00
value : 'GSTONIMPORTS' ,
} ,
] ,
default : '' ,
required : true ,
} ,
{
displayName : 'Tax Amount' ,
name : 'taxAmount' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The tax amount is auto calculated as a percentage of the line amount based on the tax rate' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Line Amount' ,
name : 'lineAmount' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The line amount reflects the discounted price if a DiscountRate has been used' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Discount Rate' ,
name : 'discountRate' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Percentage discount or discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.' ,
2020-07-12 09:12:32 -07:00
} ,
// {
// displayName: 'Tracking',
// name: 'trackingUi',
// placeholder: 'Add Tracking',
// description: 'Any LineItem can have a maximum of 2 TrackingCategory elements.',
// type: 'fixedCollection',
// typeOptions: {
// multipleValues: true,
// },
// default: {},
// options: [
// {
// name: 'trackingValues',
// displayName: 'Tracking',
// values: [
// {
// displayName: 'Name',
// name: 'name',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getTrakingCategories',
// loadOptionsDependsOn: [
// 'organizationId',
// ],
// },
// default: '',
// description: 'Name of the tracking category',
// },
// {
// displayName: 'Option',
// name: 'option',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getTrakingOptions',
// loadOptionsDependsOn: [
// '/name',
// ],
// },
// default: '',
// description: 'Name of the option',
// },
// ],
// },
// ],
// },
] ,
} ,
] ,
} ,
{
displayName : 'Additional Fields' ,
name : 'additionalFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'create' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Branding Theme Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'brandingThemeId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getBrandingThemes' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Currency Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'currency' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getCurrencies' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
displayName : 'Currency Rate' ,
name : 'currencyRate' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used.' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Date' ,
name : 'date' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Date invoice was issued - YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation.' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Due Date' ,
name : 'dueDate' ,
type : 'dateTime' ,
default : '' ,
description : 'Date invoice is due - YYYY-MM-DD' ,
} ,
{
displayName : 'Expected Payment Date' ,
name : 'expectedPaymentDate' ,
type : 'dateTime' ,
default : '' ,
description : 'Shown on sales invoices (Accounts Receivable) when this has been set' ,
} ,
{
displayName : 'Invoice Number' ,
name : 'invoiceNumber' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Line Amount Type' ,
name : 'lineAmountType' ,
type : 'options' ,
options : [
{
name : 'Exclusive' ,
value : 'Exclusive' ,
description : 'Line items are exclusive of tax' ,
} ,
{
name : 'Inclusive' ,
value : 'Inclusive' ,
description : 'Line items are inclusive tax' ,
} ,
{
name : 'NoTax' ,
value : 'NoTax' ,
description : 'Line have no tax' ,
} ,
] ,
default : 'Exclusive' ,
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Planned Payment Date' ,
2020-07-12 09:12:32 -07:00
name : 'plannedPaymentDate' ,
type : 'dateTime' ,
default : '' ,
description : 'Shown on bills (Accounts Payable) when this has been set' ,
} ,
{
displayName : 'Reference' ,
name : 'reference' ,
type : 'string' ,
default : '' ,
description : 'ACCREC only - additional reference number (max length = 255)' ,
} ,
{
displayName : 'Send To Contact' ,
name : 'sendToContact' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
description :
'Whether the invoice in the Xero app should be marked as "sent". This can be set only on invoices that have been approved.' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
name : 'Draft' ,
value : 'DRAFT' ,
} ,
{
name : 'Submitted' ,
value : 'SUBMITTED' ,
} ,
{
name : 'Authorised' ,
value : 'AUTHORISED' ,
} ,
] ,
default : 'DRAFT' ,
} ,
{
displayName : 'URL' ,
name : 'url' ,
type : 'string' ,
default : '' ,
description : 'URL link to a source document - shown as "Go to [appName]" in the Xero app' ,
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* invoice:update */
/* -------------------------------------------------------------------------- */
2020-07-12 09:12:32 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Organization Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'organizationId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getTenants' ,
} ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'update' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Invoice ID' ,
name : 'invoiceId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'update' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
} ,
{
displayName : 'Update Fields' ,
name : 'updateFields' ,
type : 'collection' ,
placeholder : 'Add Field' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'update' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
options : [
{
2022-06-03 10:23:49 -07:00
displayName : 'Branding Theme Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'brandingThemeId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getBrandingThemes' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
displayName : 'Contact ID' ,
name : 'contactId' ,
type : 'string' ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Currency Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'currency' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getCurrencies' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
displayName : 'Currency Rate' ,
name : 'currencyRate' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used.' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Date' ,
name : 'date' ,
type : 'dateTime' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Date invoice was issued - YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation.' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Due Date' ,
name : 'dueDate' ,
type : 'dateTime' ,
default : '' ,
description : 'Date invoice is due - YYYY-MM-DD' ,
} ,
{
displayName : 'Expected Payment Date' ,
name : 'expectedPaymentDate' ,
type : 'dateTime' ,
default : '' ,
description : 'Shown on sales invoices (Accounts Receivable) when this has been set' ,
} ,
{
displayName : 'Invoice Number' ,
name : 'invoiceNumber' ,
type : 'string' ,
default : '' ,
} ,
{
displayName : 'Line Amount Type' ,
name : 'lineAmountType' ,
type : 'options' ,
options : [
{
name : 'Exclusive' ,
value : 'Exclusive' ,
description : 'Line items are exclusive of tax' ,
} ,
{
name : 'Inclusive' ,
value : 'Inclusive' ,
description : 'Line items are inclusive tax' ,
} ,
{
name : 'NoTax' ,
value : 'NoTax' ,
description : 'Line have no tax' ,
} ,
] ,
default : 'Exclusive' ,
} ,
{
displayName : 'Line Items' ,
name : 'lineItemsUi' ,
placeholder : 'Add Line Item' ,
type : 'fixedCollection' ,
2022-04-22 09:29:51 -07:00
default : { } ,
2020-07-12 09:12:32 -07:00
typeOptions : {
multipleValues : true ,
} ,
description : 'Line item data' ,
options : [
{
name : 'lineItemsValues' ,
displayName : 'Line Item' ,
values : [
{
displayName : 'Line Item ID' ,
name : 'lineItemId' ,
type : 'string' ,
default : '' ,
description : 'The Xero generated identifier for a LineItem' ,
} ,
{
displayName : 'Description' ,
name : 'description' ,
type : 'string' ,
default : '' ,
description : 'A line item with just a description' ,
} ,
{
displayName : 'Quantity' ,
name : 'quantity' ,
type : 'number' ,
default : 1 ,
typeOptions : {
minValue : 1 ,
} ,
description : 'LineItem Quantity' ,
} ,
{
displayName : 'Unit Amount' ,
name : 'unitAmount' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Lineitem unit amount. By default, unit amount will be rounded to two decimal places.' ,
2020-07-12 09:12:32 -07:00
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Item Code Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'itemCode' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getItemCodes' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
2022-06-03 10:23:49 -07:00
displayName : 'Account Code Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'accountCode' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getAccountCodes' ,
2022-08-17 08:50:24 -07:00
loadOptionsDependsOn : [ 'organizationId' ] ,
2020-07-12 09:12:32 -07:00
} ,
default : '' ,
} ,
{
displayName : 'Tax Type' ,
name : 'taxType' ,
type : 'options' ,
options : [
{
name : 'Tax on Purchases' ,
value : 'INPUT' ,
} ,
{
name : 'Tax Exempt' ,
value : 'NONE' ,
} ,
{
name : 'Tax on Sales' ,
value : 'OUTPUT' ,
} ,
{
2022-05-20 14:47:24 -07:00
name : 'Sales Tax on Imports' ,
2020-07-12 09:12:32 -07:00
value : 'GSTONIMPORTS' ,
} ,
] ,
default : '' ,
required : true ,
} ,
{
displayName : 'Tax Amount' ,
name : 'taxAmount' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The tax amount is auto calculated as a percentage of the line amount based on the tax rate' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Line Amount' ,
name : 'lineAmount' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The line amount reflects the discounted price if a DiscountRate has been used' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Discount Rate' ,
name : 'discountRate' ,
type : 'string' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'Percentage discount or discount amount being applied to a line item. Only supported on ACCREC invoices - ACCPAY invoices and credit notes in Xero do not support discounts.' ,
2020-07-12 09:12:32 -07:00
} ,
// {
// displayName: 'Tracking',
// name: 'trackingUi',
// placeholder: 'Add Tracking',
// description: 'Any LineItem can have a maximum of 2 TrackingCategory elements.',
// type: 'fixedCollection',
// typeOptions: {
// multipleValues: true,
// },
// default: {},
// options: [
// {
// name: 'trackingValues',
// displayName: 'Tracking',
// values: [
// {
// displayName: 'Name',
// name: 'name',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getTrakingCategories',
// loadOptionsDependsOn: [
// 'organizationId',
// ],
// },
// default: '',
// description: 'Name of the tracking category',
// },
// {
// displayName: 'Option',
// name: 'option',
// type: 'options',
// typeOptions: {
// loadOptionsMethod: 'getTrakingOptions',
// loadOptionsDependsOn: [
// '/name',
// ],
// },
// default: '',
// description: 'Name of the option',
// },
// ],
// },
// ],
// },
] ,
} ,
] ,
} ,
{
2022-05-20 14:47:24 -07:00
displayName : 'Planned Payment Date' ,
2020-07-12 09:12:32 -07:00
name : 'plannedPaymentDate' ,
type : 'dateTime' ,
default : '' ,
description : 'Shown on bills (Accounts Payable) when this has been set' ,
} ,
{
displayName : 'Reference' ,
name : 'reference' ,
type : 'string' ,
default : '' ,
description : 'ACCREC only - additional reference number (max length = 255)' ,
} ,
{
displayName : 'Send To Contact' ,
name : 'sendToContact' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
description :
'Whether the invoice in the Xero app should be marked as "sent". This can be set only on invoices that have been approved.' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Status' ,
name : 'status' ,
type : 'options' ,
options : [
{
name : 'Draft' ,
value : 'DRAFT' ,
} ,
{
name : 'Submitted' ,
value : 'SUBMITTED' ,
} ,
{
name : 'Authorised' ,
value : 'AUTHORISED' ,
} ,
] ,
default : 'DRAFT' ,
} ,
{
displayName : 'URL' ,
name : 'url' ,
type : 'string' ,
default : '' ,
description : 'URL link to a source document - shown as "Go to [appName]" in the Xero app' ,
} ,
] ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* invoice:get */
/* -------------------------------------------------------------------------- */
2020-07-12 09:12:32 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Organization Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'organizationId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getTenants' ,
} ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'get' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Invoice ID' ,
name : 'invoiceId' ,
type : 'string' ,
default : '' ,
required : true ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'get' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
} ,
2022-08-17 08:50:24 -07:00
/* -------------------------------------------------------------------------- */
/* invoice:getAll */
/* -------------------------------------------------------------------------- */
2020-07-12 09:12:32 -07:00
{
2022-06-03 10:23:49 -07:00
displayName : 'Organization Name or ID' ,
2020-07-12 09:12:32 -07:00
name : 'organizationId' ,
type : 'options' ,
2022-08-17 08:50:24 -07:00
description :
'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code-examples/expressions/">expression</a>' ,
2020-07-12 09:12:32 -07:00
typeOptions : {
loadOptionsMethod : 'getTenants' ,
} ,
default : '' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'getAll' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
required : true ,
} ,
{
displayName : 'Return All' ,
name : 'returnAll' ,
type : 'boolean' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'getAll' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
default : false ,
2022-05-06 14:01:25 -07:00
description : 'Whether to return all results or only up to a given limit' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Limit' ,
name : 'limit' ,
type : 'number' ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'getAll' ] ,
returnAll : [ false ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
typeOptions : {
minValue : 1 ,
maxValue : 100 ,
} ,
default : 100 ,
2022-05-06 14:01:25 -07:00
description : 'Max number of results to return' ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Options' ,
name : 'options' ,
type : 'collection' ,
placeholder : 'Add Option' ,
default : { } ,
displayOptions : {
show : {
2022-08-17 08:50:24 -07:00
resource : [ 'invoice' ] ,
operation : [ 'getAll' ] ,
2020-07-12 09:12:32 -07:00
} ,
} ,
options : [
{
displayName : 'Created By My App' ,
name : 'createdByMyApp' ,
type : 'boolean' ,
default : false ,
2022-08-17 08:50:24 -07:00
description : "Whether you'll only retrieve Invoices created by your app" ,
2020-07-12 09:12:32 -07:00
} ,
{
displayName : 'Order By' ,
name : 'orderBy' ,
type : 'string' ,
placeholder : 'InvoiceID' ,
default : '' ,
description : 'Order by any element returned' ,
} ,
{
displayName : 'Sort Order' ,
name : 'sortOrder' ,
type : 'options' ,
options : [
{
name : 'Asc' ,
value : 'ASC' ,
} ,
{
name : 'Desc' ,
value : 'DESC' ,
} ,
] ,
default : '' ,
} ,
{
displayName : 'Statuses' ,
name : 'statuses' ,
type : 'multiOptions' ,
options : [
{
name : 'Draft' ,
value : 'DRAFT' ,
} ,
{
name : 'Submitted' ,
value : 'SUBMITTED' ,
} ,
{
name : 'Authorised' ,
value : 'AUTHORISED' ,
} ,
] ,
default : [ ] ,
} ,
{
displayName : 'Where' ,
name : 'where' ,
type : 'string' ,
typeOptions : {
alwaysOpenEditWindow : true ,
} ,
placeholder : 'EmailAddress!=null&&EmailAddress.StartsWith("boom")' ,
default : '' ,
2022-08-17 08:50:24 -07:00
description :
'The where parameter allows you to filter on endpoints and elements that don\'t have explicit parameters. <a href="https://developer.xero.com/documentation/api/requests-and-responses#get-modified">Examples Here</a>.' ,
2020-07-12 09:12:32 -07:00
} ,
] ,
} ,
2021-12-03 00:44:16 -08:00
] ;