Create Xero invoices from Paperform payments

Create or update a Xero contact and a draft sales invoice for each submission on your Paperform payment form, so the sale is in Xero. Test with one order first.

Last checked

The "Create Xero invoices from Paperform payments" workflow in Stepper's editor: Paperform: New Submission, then Stepper: Run code, then Xero: Create/Update Contact, then Xero: Create Sales Invoice

What it does

When you take payments through a Paperform form (orders, deposits, registrations), the money goes through your payment gateway. The sale still has to be recorded in Xero, and doing that by hand for every order adds up.

For each new submission with a payment, a code step reads the payment total, turns the submission time into a YYYY-MM-DD date and builds one line item: "Paperform payment, submission" plus the submission ID, a quantity of 1 and the payment amount. Then the workflow creates or updates the customer as a Xero contact from their first name, last name and email, and raises a sales invoice for that contact, dated the day of the submission, with the reference "Paperform submission" plus the submission ID.

The template doesn't set an invoice status, so the invoice arrives in Xero as a draft for you to review. The line item has no account code or tax type yet: add them in Xero when you review the draft, or add them to the code step. The rule after the trigger only continues when the submission has a payment total above zero, so submissions without a payment never start the code step or reach Xero.

The steps

  1. Paperform: New Submission

    Starts the workflow every time the Paperform form you choose gets a new submission.

  2. Stepper: Run code

    Turns the submission time into a YYYY-MM-DD date and builds one line item with "Paperform payment, submission" plus the ID, quantity 1 and the payment amount.

  3. Xero: Create/Update Contact

    Creates the customer as a Xero contact named "First name Last name" from the form, with their first name, last name and email. If a contact with that name already exists, Xero updates it instead.

  4. Xero: Create Sales Invoice

    Creates a draft sales invoice for the contact from the previous step, dated and due on the day of the submission, with the reference "Paperform submission" plus its ID and the line item from the code step.

What you need connected

You also need a Stepper account. Each app's page lists every trigger and action Stepper has for it.

How to set it up

  1. Sign in to Stepper with your Paperform account. Every Paperform plan includes unlimited workflows, within fair use.
  2. Click Use this template in Stepper. Stepper copies the workflow into your account and asks you to connect Paperform and Xero if you haven’t already.
  3. In the Paperform trigger, choose your payment form. The template uses questions with the keys firstName, lastName and email, and the code step reads the payment total from Paperform’s _charge.total. If your questions have other keys, pick your own answers with the data picker.
  4. In each Xero step, choose your organization.
  5. In the invoice step, check the contact, dates, reference and line items. Contact is mapped to the contact ID from the Create/Update Contact step, and Line Items comes from the code step. The template leaves Status empty, so the invoice is created as a draft. The line item has no account code or tax type, so add them in Xero when you review the draft, or add AccountCode and TaxType to the line item JSON in the code step, using the codes your bookkeeper uses for these sales.
  6. Make one real payment through your form (you can refund it afterwards) and run a test. Check in Xero that the draft invoice has the right amount, date and reference, then click Publish.

What you can change

  • Line items. In the code step, replace the single “Paperform payment” line with the products from the submission, so the invoice shows what was bought.
  • Which submissions count. The condition on the rule after the trigger checks Paperform’s _charge.total is above zero. Change it if you want to filter on a product or answer instead. The code step also stops the run if a total is missing, as a backstop.
  • Tax. Set the line amount type to match how your prices are entered, tax inclusive or exclusive.
  • Currency. The template doesn’t set a currency, so Xero uses your organization’s base currency. If your form charges in a different currency, set Currency Code in the invoice step.

See all workflow templates