Skip to main content

Xero

ProEvents Manager Pro - XeroRequires Events Manager Pro. Compare plans

The Xero add-on adds a payment method called Xero Invoice. When a customer books a paid event with it, your site creates an approved invoice in your Xero organization, then either sends the customer to Xero's online invoice to pay or has Xero email them the invoice. When the invoice is paid, Xero notifies your site and the booking is approved.

Only bookings made with the Xero Invoice payment method get an invoice. Bookings paid through Stripe, PayPal or any other gateway are not sent to Xero.

Before you start
  • Events Manager Pro 3.8.3.1 or later and the Events Manager Pro - Xero plugin, both activated. The plugin needs PHP 7.4 or later.
  • A Xero account you can sign in to. The same login works at developer.xero.com, where you register a free app.
  • Your site served over HTTPS. The payment method is hidden from booking forms without it, and while the site is not connected to Xero.

How it works​

  1. A customer books a paid event and chooses Pay via Xero Invoice.
  2. Your site finds or creates the customer as a contact in Xero, matching on their email address, and creates an invoice for the booking.
  3. Depending on your settings, the customer is redirected to Xero's online invoice to pay, or Xero emails them the invoice.
  4. When the invoice is paid, Xero calls your site (a webhook) and the booking is approved.

You connect to Xero once, through an app you register in Xero's developer portal.

1. Create a Xero app​

Sign in at developer.xero.com, go to My Apps and click New app.

My Apps in Xero's developer portal.

Fill in the form:

FieldWhat to enter
App nameAnything that identifies your site. It is shown on Xero's consent screen when you connect.
Integration typeWeb app.
Company or application URLYour website address.
Redirect URIThe address shown on the Xero Connection tab of the gateway's settings on your site (see step 2), after the words Your url for this site is.

The redirect URI is the one value you copy from your own site.

Once the app exists, open its Configuration page. It shows your Client id and a button to Generate a secret. You need both in the next step.

The client secret is shown once, when you generate it.

Keep your secret safe

The client secret is shown only once and works like a password. Don't share it or post it anywhere public. If you lose it, generate a new one and save that on your site.

2. Connect your site to Xero​

  1. Go to Events then Payment Gateways, click Xero Invoice and open the Xero Connection tab.

    The Xero Connection tab before connecting.

  2. Paste Xero's client id into Xero App ID and the client secret into Xero App Secret.

  3. Click Save Changes.

  4. Click Connect. Xero asks you to approve the connection. Pick the organization you want to use and allow access. You can pick more than one, for example your own organization and Xero's Demo Company for testing.

You come back to the Xero Connection tab, which now shows the connection.

Connected. Disconnect is here if you ever need it.

The add-on asks Xero for access to contacts and invoices only. It refreshes the connection once a day in the background, so it does not lapse when no invoices are raised for a while. If Xero ever rejects the connection, the payment method is hidden from booking forms and a notice in wp-admin asks you to reconnect.

3. Set up the webhook​

The webhook is how Xero tells your site that an invoice was paid. On the Xero Connection tab, the Webhook section shows a Delivery URL and a Webhook signing key field.

Copy the Delivery URL into Xero, and Xero's signing key back into this field.

  1. In Xero's developer portal, open your app and go to Webhooks.

  2. Set the delivery URL to the one shown on your site, and subscribe to the Invoices event.

  3. Xero shows a signing key. Paste it into Webhook signing key on your site and click Save Changes.

One delivery URL and one signing key cover both test and live mode. Once the key is saved, the field is shown empty with the hint Leave blank to keep the saved key., so you can save other settings without entering it again.

4. Choose your organization and account code​

The gateway has a test mode and a live mode, like every other gateway. For Xero the two modes share one connection and differ only in which connected organization receives the invoices.

On the [Live] API Keys/Notifications tab, under the heading for the live organization and account, pick the organization in the first menu and enter your Sales account code. That is the revenue account from your Xero chart of accounts that invoice lines are posted to, for example 200. It is required, because Xero rejects invoices without it.

Live mode settings.

On the [Test] API Keys/Notifications tab, do the same for testing. Xero's Demo Company is a good choice. Leave the menu on its first option to use the same organization as live mode. This tab also has the Limited Test Mode settings described in Test mode.

Test mode settings.

Match your tax rate to the Xero account

Xero works out the tax on each invoice from the account code you choose. The invoice total always equals the booking total, but if your Events Manager tax rate and the Xero account's tax rate differ, the split between net and tax on the invoice follows Xero.

5. Gateway options​

Gateway Options.

SettingWhat it does
Pay online (redirect)Yes (the default) sends the customer to Xero's online invoice to pay straight away. This needs online invoice payments enabled in your Xero organization. No has Xero email them the invoice to pay from their inbox.
Booking status while awaiting paymentAwaiting Online Payment suits paying straight away. Awaiting Payment (offline) suits an emailed invoice paid later by bank transfer.
Days to PayDays from the booking until the invoice is due. Default 14.
Email invoice from XeroWhen redirecting to pay online, also has Xero email the invoice. With Pay online (redirect) set to No the invoice is always emailed.
Branding Theme IDOptional. The ID of a Xero branding theme to apply to invoices.

The General Options tab has the settings every gateway shares: Gateway Title (default Pay via Xero Invoice), QuickPay Payment Button, messages, Unpaid Bookings Expiry, Expired Booking Action and Manually approve completed transactions?.

6. Activate and make a test booking​

  1. Go back to Events then Payment Gateways and click Activate under Xero Invoice.

  2. Check that the gateway is in test mode and that the Test tab points at the organization you want to test with.

  3. Book a paid event on your site and choose Pay via Xero Invoice.

  4. Find the invoice in Xero, mark it as paid, and check that the booking becomes Approved on your site.

The invoice's reference is the event name.

When you are happy, click Enable Live Mode in the banner above the tabs.

What ends up in Xero​

Each invoice has one line per ticket type, extra lines for surcharges and one negative line for discounts. Amounts are sent tax inclusive, so the total matches the booking. The reference is the event name, or Multiple Events for a Multiple Bookings cart, and the invoice links back to the booking in wp-admin.

Payments are read from Xero, never written to it. Each payment applied to the invoice in Xero, including part payments, is recorded as a transaction on the booking.

Unpaid, voided and refunded invoices​

  • An unpaid invoice does not expire by itself. When the gateway's Unpaid Bookings Expiry passes, your site only asks Xero for the invoice's status again. A booking whose invoice is still open stays as it is.
  • Voiding or deleting the invoice in Xero applies the gateway's Expired Booking Action to the booking: Delete removes it (or cancels it if it has payments recorded), Cancel cancels it, and No Action leaves it. Save the gateway's General Options tab once so the action you see there is the one in force.
  • Spaces are held for an unpaid Xero booking only while an unpaid booking expiry applies to the gateway, here or in the site-wide setting. See Unpaid, abandoned and expired bookings.
  • Refunds and credit notes entered in Xero do not change the booking, and canceling a booking on your site does not void its invoice. Do both by hand.
  • The customer can come back. While a booking is awaiting payment, My Bookings shows a View / Pay Invoice button that opens the online invoice.

The Xero Invoice gateway can't be used on the payment page or for partial payments.

Troubleshooting​

A notice says the site is not connected to a Xero organization

Open the Xero Connection tab and click Connect. If you have changed the app ID or secret, save first, then connect. The payment method stays hidden from booking forms until the connection works.

The customer was not redirected to pay

The redirect needs Xero to return an online invoice link, which depends on online invoice payments being enabled in your Xero organization. When Xero returns no link, the invoice is emailed instead and the customer is told to check their inbox.

Bookings are not being approved when invoices are paid

Check that the delivery URL and signing key in Xero match your site and that the app is subscribed to the Invoices event. With Booking status while awaiting payment set to Awaiting Payment (offline), the webhook is the only way your site hears about the payment, so it has to work.

The customer sees "An unknown error has occurred creating the Xero invoice, please contact us for further assistance."

Xero rejected the invoice. The most common cause is a missing or wrong Sales account code for the mode the gateway is in.

The invoice tax looks different from the booking

See the tax caution above, and match your Events Manager tax rate to the tax rate of the Xero account.