/** * Xero Node - Version 1 * Discriminator: resource=invoice, operation=create */ interface Credentials { xeroOAuth2Api: CredentialReference; } /** Create a contact */ export type XeroV1InvoiceCreateParams = { resource: 'invoice'; operation: 'create'; /** * Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a> */ organizationId?: string | Expression; /** * Invoice Type */ type?: 'ACCPAY' | 'ACCREC' | Expression; /** * Contact ID */ contactId?: string | Expression | PlaceholderValue; /** * Line item data * @default {} */ lineItemsUi?: { /** Line Item */ lineItemsValues?: Array<{ /** A line item with just a description */ description?: string | Expression | PlaceholderValue; /** LineItem Quantity * @default 1 */ quantity?: number | Expression; /** Lineitem unit amount. By default, unit amount will be rounded to two decimal places. */ unitAmount?: string | Expression | PlaceholderValue; /** Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a> */ itemCode?: string | Expression; /** Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a> */ accountCode?: string | Expression; /** Tax Type */ taxType?: 'INPUT' | 'NONE' | 'OUTPUT' | 'GSTONIMPORTS' | Expression; /** The tax amount is auto calculated as a percentage of the line amount based on the tax rate */ taxAmount?: string | Expression | PlaceholderValue; /** The line amount reflects the discounted price if a DiscountRate has been used */ lineAmount?: string | Expression | PlaceholderValue; /** 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. */ discountRate?: string | Expression | PlaceholderValue; }>; }; /** * Additional Fields * @default {} */ additionalFields?: { /** Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a> */ brandingThemeId?: string | Expression; /** Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a> */ currency?: string | Expression; /** The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. */ currencyRate?: string | Expression | PlaceholderValue; /** 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. */ date?: string | Expression; /** Date invoice is due - YYYY-MM-DD */ dueDate?: string | Expression; /** Shown on sales invoices (Accounts Receivable) when this has been set */ expectedPaymentDate?: string | Expression; /** Invoice Number */ invoiceNumber?: string | Expression | PlaceholderValue; /** Line Amount Type * @default Exclusive */ lineAmountType?: 'Exclusive' | 'Inclusive' | 'NoTax' | Expression; /** Shown on bills (Accounts Payable) when this has been set */ plannedPaymentDate?: string | Expression; /** ACCREC only - additional reference number (max length = 255) */ reference?: string | Expression | PlaceholderValue; /** Whether the invoice in the Xero app should be marked as "sent". This can be set only on invoices that have been approved. * @default false */ sendToContact?: boolean | Expression; /** Status * @default DRAFT */ status?: 'DRAFT' | 'SUBMITTED' | 'AUTHORISED' | Expression; /** URL link to a source document - shown as "Go to [appName]" in the Xero app */ url?: string | Expression | PlaceholderValue; }; }; export type XeroV1InvoiceCreateOutput = { AmountPaid?: number; BrandingThemeID?: string; Contact?: { Addresses?: Array<{ AddressType?: string; City?: string; Country?: string; PostalCode?: string; Region?: string; }>; BankAccountDetails?: string; ContactGroups?: Array<{ ContactGroupID?: string; HasValidationErrors?: boolean; Name?: string; Status?: string; }>; ContactID?: string; ContactPersons?: Array<{ EmailAddress?: string; FirstName?: string; IncludeInEmails?: boolean; LastName?: string; }>; ContactStatus?: string; EmailAddress?: string; HasValidationErrors?: boolean; IsCustomer?: boolean; IsSupplier?: boolean; Name?: string; Phones?: Array<{ PhoneAreaCode?: string; PhoneCountryCode?: string; PhoneNumber?: string; PhoneType?: string; }>; UpdatedDateUTC?: string; }; CurrencyCode?: string; CurrencyRate?: number; Date?: string; DateString?: string; HasErrors?: boolean; InvoiceID?: string; InvoiceNumber?: string; IsDiscounted?: boolean; LineAmountTypes?: string; LineItems?: Array<{ Description?: string; LineItemID?: string; TaxType?: string; }>; Reference?: string; SentToContact?: boolean; Status?: string; Type?: string; UpdatedDateUTC?: string; }; export type XeroV1InvoiceCreateNode = { type: 'n8n-nodes-base.xero'; version: 1; credentials?: Credentials; config: NodeConfig; output?: Items; };