Create Invoice
Xero
Xero
Create Invoice
Create a new sales invoice (ACCREC) or purchase bill (ACCPAY) in Xero with support for the major documented invoice fields, structured line items, optional invoice addresses, unit precision, and per-invoice validation errors.
ActionAI Tool
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
xero_tenant_id | dropdown | Required | The Xero organisation (tenant) to target. Loaded dynamically from the connected account's authorised organisations. |
type | select | Required | Invoice type. ACCREC creates a sales invoice and ACCPAY creates a bill. (options: Accounts Receivable (Sales Invoice), Accounts Payable (Bill)) |
contact | object | Required | Invoice contact. Xero recommends providing only ContactID when creating or updating invoices. |
ContactID | text | Required | Xero ContactID for the invoice contact. |
date | text | Optional | Invoice issue date in YYYY-MM-DD or Xero-compatible date string format. |
due_date | text | Optional | Invoice due date in YYYY-MM-DD or Xero-compatible date string format. |
line_amount_types | select | Optional | Whether line amounts are tax exclusive, tax inclusive, or no tax. (options: Exclusive, Inclusive, No Tax) |
invoice_number | text | Optional | Invoice number. For ACCREC this must be unique. |
reference | text | Optional | Additional reference number for ACCREC invoices. |
branding_theme_id | text | Optional | Branding theme identifier to apply to the invoice. |
url | text | Optional | Source document URL shown as Go to [appName] in Xero. |
currency_code | text | Optional | ISO 4217 currency code to raise the invoice in. |
currency_rate | number | Optional | Optional exchange rate for multi-currency invoices. |
status | select | Optional | Initial invoice status. If omitted, Xero defaults to DRAFT. (options: Draft, Submitted, Authorised) |
sent_to_contact | yes/no | Optional | Set true to mark an approved invoice as sent in Xero. |
expected_payment_date | text | Optional | Expected payment date for ACCREC invoices. |
planned_payment_date | text | Optional | Planned payment date for ACCPAY bills. |
line_items | array of object | Required | Invoice line items. At least one line item is required to create a complete invoice. |
Description | text | Required | Line item description. Xero requires at least one character. |
Quantity | number | Optional | Line item quantity. |
UnitAmount | number | Optional | Unit amount for the line item. |
ItemCode | text | Optional | Xero item code to use for the line. |
AccountCode | text | Optional | Revenue or expense account code. |
LineItemID | text | Optional | Optional existing line item ID. Usually used on updates. |
TaxType | text | Optional | Tax type override for the line item. |
TaxAmount | number | Optional | Explicit tax amount override for the line item. |
LineAmount | number | Optional | Explicit line amount if you want Xero to use a precomputed value. |
DiscountRate | number | Optional | Percentage discount applied to the line item. Supported on ACCREC invoices. Mutually exclusive with DiscountAmount. |
DiscountAmount | number | Optional | Flat discount amount applied to the line item. Supported on ACCREC invoices. Mutually exclusive with DiscountRate. |
Tracking | array of object | Optional | Up to two tracking category selections for the line item. |
TrackingCategoryID | text | Optional | Tracking category identifier when known. |
Name | text | Optional | Tracking category name. |
Option | text | Optional | Tracking option name. |
invoice_addresses | array of object | Optional | Invoice address objects for US sales tax scenarios when applicable. |
InvoiceAddressType | text | Optional | Whether the address is FROM or TO. |
AddressLine1 | text | Optional | Address line 1. |
AddressLine2 | text | Optional | Address line 2. |
AddressLine3 | text | Optional | Address line 3. |
AddressLine4 | text | Optional | Address line 4. |
City | text | Optional | City. |
Region | text | Optional | Region or state. |
PostalCode | text | Optional | Postal or ZIP code. |
Country | text | Optional | Country. |
unitdp | number | Optional | Optional unit decimal place precision for unit amounts. Xero supports values such as 4. |
summarize_errors | yes/no | Optional | When false, Xero returns validation errors for each invoice in the response. |
Outputs
| Name | Type | Description |
|---|---|---|
statusCode | number | HTTP status code from the Xero API response. |
body | object | Structured Xero response envelope. Access created invoices via body.Invoices. |
Id | text | Xero correlation/request identifier for this API call. |
Status | text | Xero operation status, typically OK. |
ProviderName | text | Name of the Xero app/provider handling the request. |
DateTimeUTC | text | UTC timestamp of the response. |
Invoices | array of object | Invoices or bills returned by Xero. |
Type | text | Invoice type such as ACCREC or ACCPAY. |
Contact | object | Contact associated with the invoice (summary form, plus nested Addresses and Phones). |
ContactID | text | Unique Xero identifier for the contact. |
ContactStatus | text | Current contact status. |
Name | text | Name of the contact. |
EmailAddress | text | Primary email address. |
ContactNumber | text | External contact code. |
AccountNumber | text | User-defined account number. |
UpdatedDateUTC | text | UTC timestamp of the contact's last update. |
IsSupplier | yes/no | Whether the contact is treated as a supplier. |
IsCustomer | yes/no | Whether the contact is treated as a customer. |
Addresses | array of object | Addresses attached to the contact. |
AddressType | text | Address type such as STREET or POBOX. |
AddressLine1 | text | Address line 1. |
AddressLine2 | text | Address line 2. |
AddressLine3 | text | Address line 3. |
AddressLine4 | text | Address line 4. |
City | text | City. |
Region | text | Region / state / province. |
PostalCode | text | Postal or ZIP code. |
Country | text | Country. |
AttentionTo | text | Attention-to field for the address. |
Phones | array of object | Phones attached to the contact. |
PhoneType | text | Phone type such as DEFAULT, DDI, FAX, or MOBILE. |
PhoneNumber | text | Phone number. |
PhoneAreaCode | text | Phone area code. |
PhoneCountryCode | text | Phone country code. |
Date | text | Xero formatted invoice issue date. |
DateString | text | ISO-style invoice issue date string. |
DueDate | text | Xero formatted invoice due date. |
DueDateString | text | ISO-style invoice due date string. |
Status | text | Invoice status. |
LineAmountTypes | text | Whether line amounts are Exclusive, Inclusive, or NoTax. |
LineItems | array of object | Line items on the invoice. |
Description | text | Line item description. |
Quantity | text | Line item quantity. |
UnitAmount | text | Unit amount for the line item. |
ItemCode | text | Related Xero item code. |
AccountCode | text | Related Xero account code. |
AccountId | text | Related Xero account ID. |
LineItemID | text | Unique Xero line item identifier. |
TaxType | text | Tax type used for the line item. |
TaxAmount | text | Tax amount for the line item. |
LineAmount | text | Total line amount after discounts. |
DiscountRate | text | Percentage discount applied to the line item. |
DiscountAmount | text | Flat discount applied to the line item. |
Item | object | Referenced Xero item details. |
ItemID | text | Unique Xero item identifier. |
Name | text | Item name. |
Code | text | Item code. |
Tracking | array of object | Tracking category values on the line item. |
TrackingCategoryID | text | Tracking category ID. |
Name | text | Tracking category name. |
Option | text | Selected tracking option. |
SubTotal | text | Total before tax. |
TotalTax | text | Total tax amount. |
Total | text | Invoice total including tax. |
TotalDiscount | text | Total discount amount applied to the invoice. |
UpdatedDateUTC | text | UTC timestamp of the invoice's last update. |
CurrencyCode | text | Invoice currency code. |
CurrencyRate | text | Exchange rate used by Xero. |
InvoiceID | text | Unique Xero invoice identifier. |
InvoiceNumber | text | Invoice number shown in Xero. |
Reference | text | Additional reference number. |
BrandingThemeID | text | Branding theme identifier. |
Url | text | Source document URL shown in Xero. |
SentToContact | yes/no | Whether the invoice is marked as sent in Xero. |
ExpectedPaymentDate | text | Expected payment date on sales invoices. |
PlannedPaymentDate | text | Planned payment date on bills. |
HasAttachments | yes/no | Whether the invoice has attachments. |
RepeatingInvoiceID | text | Repeating invoice template identifier when applicable. |
Payments | array of object | Payments applied to the invoice. |
CreditNotes | array of object | Credit notes applied to the invoice. |
Prepayments | array of object | Prepayments applied to the invoice. |
Overpayments | array of object | Overpayments applied to the invoice. |
AmountDue | text | Outstanding amount still due. |
AmountPaid | text | Amount paid so far. |
CISDeduction | text | CIS deduction amount when applicable. |
FullyPaidOnDate | text | Date the invoice became fully paid. |
AmountCredited | text | Total credited amount. |
SalesTaxCalculationTypeCode | text | US sales tax calculation type code when applicable. |
InvoiceAddresses | array of object | Invoice address details for US organisations when applicable. |
ValidationErrors | array of object | Validation errors returned for the invoice when Xero includes them. |
Message | text | Validation error message. |