Turn signed SignWell contracts into draft Xero invoices

The moment a customer signs, the invoice is drafted in Xero with the right amount and due date, and your finance channel gets the details.

Deterministic Code
SignWellXeroSlack BotFinanceOperationsData SyncDocument ProcessingNotifications & Alerts
PromptCreate

When a customer signs a contract in SignWell, I want the invoice raised in Xero the same minute, instead of waiting for someone to notice the signed document and key it into the accounting system by hand. Build this as a code workflow: every step is a fixed mapping from signed document fields to invoice fields, with no matching ambiguity.

Trigger the workflow with a webhook on the SignWell document_completed event. That is the event SignWell fires once every signer has finished, and it carries the id of the completed document.

Before doing anything else, check the document name against a contract naming pattern and stop the run if it does not match. Only billable paperwork should ever reach Xero, so NDAs, consent forms, and other non billable documents are ignored. Default the pattern to names containing Contract, Service Agreement, MSA, or Order Form, case insensitive, and keep it in one clearly marked place at the top of the workflow so it is easy to edit.

For documents that pass the filter, call SignWell Get Document with the document id from the webhook payload. Read the signer name, signer email, and company from the recipients, and read the completed field values off the document: the agreed amount, the plan, the billing term, and the payment terms. Note that fields on a SignWell document is a two dimensional array with one inner array per file, so flatten across the files and match values by their field label or api id rather than assuming a flat structure or a fixed position.

Then set up the customer in Xero. Look the contact up first with List Contacts filtered on the signer email so a repeat customer is reused rather than duplicated, and only call Create Contacts when there is no match. Use the company name from the document as the contact name when there is one and fall back to the signer name, and set the signer name and email as the contact's primary person. Every Xero call needs the tenant id of the target organisation.

Raise the invoice with Create Invoices as an accounts receivable invoice in DRAFT status, never approved or sent, so a human approves it before it reaches the customer. Build the line item from the plan and the agreed amount read off the contract. Put the SignWell document id into the invoice reference field so finance can reconcile any invoice back to the exact signed contract later. Derive the due date from the payment terms field on the document rather than hardcoding it: read the terms, for example Net 15, Net 30, or Due on receipt, and add the matching number of days to the completion date, falling back to Net 30 only when the field is empty.

Finish by posting to the finance channel with Slack Bot Send a Message, showing the customer, the invoice amount, the due date, and the invoice reference, plus a note that the invoice is sitting in draft and needs approval.

If the agreed amount or the payment terms field is missing or cannot be parsed, do not guess. Skip the invoice and post a Slack message naming the document and the missing field so someone can finish it manually.

Example output

New contract signed. Draft invoice ready for approval. Customer: Northwind Logistics Ltd Amount: $24,000.00 Due: 8 September 2026 (Net 30) Reference: SignWell doc a1b2c3d4 Sitting in Xero as a draft, needs approval before it goes out.

What does this prompt do?

  • Watches for contracts that reach fully signed status in SignWell and picks them up the moment signing finishes.
  • Reads the signer, the company, the agreed amount, the plan, and the payment terms straight off the signed document.
  • Adds the customer to Xero if they are new, then raises the invoice as a draft with the due date worked out from the payment terms on the contract.
  • Posts the customer, amount, due date, and reference into your finance channel in Slack so someone can approve and send.

What do I need to use this?

  • A SignWell account where your contracts get signed
  • A Xero organisation you can raise invoices in
  • A Slack workspace with a finance channel to post into
  • A naming convention for contracts, so billable paperwork can be told apart from NDAs and other documents

How can I customize it?

  • Change which documents count as billable by editing the contract naming pattern, so NDAs and other paperwork stay out of your accounting system.
  • Keep the approval step permanently, or let the invoice send itself once you trust the numbers.
  • Point the notification at a different channel, or invoice out of QuickBooks Online instead of Xero if that is where your finance team works.

FAQs

Will the invoice be sent to the customer automatically?
No. The invoice is created as a draft in Xero so someone on your team reviews and approves it before it goes out. If you would rather it send itself, that is a small change once you trust the numbers.
What stops it invoicing for an NDA or other non billable document?
The workflow only runs for documents whose name matches your contract naming pattern. Anything else that gets signed, such as an NDA or a consent form, is ignored.
How does it know when the invoice is due?
It reads the payment terms recorded on the signed contract, so Net 15 and Net 30 customers each get the right date instead of every invoice getting the same hardcoded one.
What happens if the same customer signs more than one contract?
The customer is looked up in Xero first and reused if they already exist, so you do not end up with duplicate records. Each new contract still raises its own invoice.
How do we match an invoice back to the contract it came from?
The signed document reference is written onto the invoice, so anyone in finance can trace an invoice back to the exact contract that was signed.

Related templates

Build a credential rotation checklist when someone leaves

When someone leaves, we check which shared passwords they used in their final months and post a ranked rotation list to your security channel.

1Password
Rippling
Slack Bot
+1
Agentic Task
Weekly Amazon S3 bucket security audit posted to Slack

Every Monday, check every S3 bucket for public exposure, missing encryption and weak backup settings, then get the risks ranked in Slack.

Amazon S3
Slack Bot
Google Sheets
Agentic Task
Log Agorapulse social conversations to HubSpot contacts

Twice every weekday, the conversations from your social inbox land on the right HubSpot contact timelines, with a Slack recap for sales.

Agorapulse
HubSpot
Slack Bot
Agentic Task
Clean up HubSpot contacts from your Amazon SES suppression list

Every morning, find the addresses that hard bounced or filed a spam complaint, update the matching HubSpot contacts, and post a short Slack recap.

Amazon SES
HubSpot
Slack Bot
Agentic Task
Draft polite follow-ups for emails that never got a reply

Every weekday at 4pm, spot the threads that went quiet, stage a ready-to-send nudge in your mailbox, and get a ranked Slack recap.

Aurinko
Google Sheets
Slack Bot
Agentic Task
Replay failed SQS messages when a bug fix is merged

When you merge a fix in GitHub, this agent checks the matching dead-letter queue, replays the failed messages, and reports back on the pull request and in Slack.

Amazon SQS
GitHub
Slack Bot
Agentic Task

Stop retyping signed contracts into your accounting system.

Every signed contract becomes a draft invoice with the right amount, due date, and reference before anyone has to notice it.