XERO Create invoice function

The XERO Create invoice function in RPA.

Help CentreFunctions & Formulas

This article describes the RPA Xero connector function to create an invoice.

For a full list of available functions, please read XERO functions.


Description

The Create invoice function creates a new invoice in Xero. Specify the type (ACCREC for sales invoices, ACCPAY for purchase invoices/bills), the contact, and line items with descriptions, quantities, unit amounts, and account codes.


Setting it up

{{popups:rpas/add:action=xero-create-invoice}}

Once on a process map:

  1. Navigate to the process where you would like to add the function
  2. Click on the green button’s drop-down (right side of the green button labelled “Process”)
  3. On the menu that appears, click on the “+ Activity” item
  4. From here you can select the XERO Create invoice option
  5. Click "Add" once you are done

Input parameters

ParameterRequiredTypeDefaultDescription
ConnectorYesSelect-Select the Xero connector to use
TypeYesSelect-ACCREC (sales invoice) or ACCPAY (purchase invoice/bill)
ContactYesText-Contact as JSON: {"ContactID":"{contact_id}"} or {"Name":"Company Name"}
Line ItemsYesTextarea-JSON array of line items, e.g. [{"Description":"Consulting","Quantity":1,"UnitAmount":1000,"AccountCode":"200"}]
VariableYesText-Variable to store the created invoice

Output variables

VariableTypeDescription
VariableObjectThe created invoice with InvoiceID, InvoiceNumber, Total, Status, etc.

Errors

  • Contact not found – the specified contact does not exist
  • Invalid account code – the account code in a line item is invalid
  • Validation error – required fields are missing

Tips

  • Use ACCREC for invoices you send to customers, ACCPAY for bills from suppliers
  • You can create contacts by Name if they don’t exist yet
  • Access the invoice number via {variable.InvoiceNumber} after creation
  • Line items support TaxType for tax calculations

Related functions

  • List invoices – List all invoices
  • Create payment – Pay against an invoice
  • List contacts – Find contact IDs

See it working on your own data

Everything documented here ships with the platform – try the document tools free, or go live in 7 days.