<!-- Markdown rendering of https://accountingkit.dev/use-cases/quote-to-invoice/ -->

> One durable workflow accepts a Xero quote, raises the linked invoice, and creates a purchase order per supplier. A failure resumes from the failed step.

Use case 02 · Quote to invoice

# Turn an accepted quote into an invoice and supplier purchase orders

When a customer accepts a quote in your product, one AccountingKit workflow accepts the quote in Xero, creates the linked draft invoice, and creates one purchase order for each supplier. Every step is persisted. If a step fails, the workflow retries and resumes from that step, so the invoice and earlier purchase orders are never created twice.

[Start free](https://app.accountingkit.dev/auth/login) [Automations](https://docs.accountingkit.dev/docs/automations) [Talk to us](https://accountingkit.dev/contact/?topic=integration)

Facts checked 27 November 2026

## How it works

1.  Trigger
    
    ### Your customer accepts a quote
    
    Your product decides the quote is accepted and knows which suppliers need a purchase order.
    
2.  Queue
    
    ### Queue one recipe
    
    Send the quote ID, your deal reference, and the purchase orders to create. Every purchase order is validated before any write reaches Xero. The API answers 202 with an operation ID.
    
    `POST /v1/automations`
    
3.  Run
    
    ### The steps run in order and are saved
    
    The workflow sends and accepts the quote, creates the invoice, marks the quote invoiced, then creates each purchase order as its own step.
    
    `send_quote · accept_quote · create_invoice · mark_quote_invoiced · create_purchase_order:<index>`
    
4.  Finish
    
    ### You get one signed result
    
    A signed event tells you the run succeeded or failed. You can also read the operation at any time to see its state and attempts.
    
    `automation.succeeded`
    

## Who builds this

-   Quoting and CPQ tools whose users keep their books in Xero.
-   Order management and procurement products that buy from suppliers once a deal closes.
-   Project and job management tools where an accepted quote starts both billing and purchasing.

## The request

The purchase\_orders array is optional. Leave it out and the recipe stops after the invoice.

```

```

## Events you receive

Events are signed. Verify the `AccountingKit-Signature` header against the raw body before you parse it, and deduplicate on the event ID.

| Event | When it is sent |
| --- | --- |
| automation.succeeded | Every step completed. The run is metered once. |
| automation.failed | The run could not complete. The operation record shows the failing step. |
| quote.status_changed | A quote moved status during reconciliation, for example sent to accepted. |

## Coverage by accounting system

The quote.accept\_and\_create\_invoice recipe runs on Xero. On the other systems you can make the same writes one call at a time, with your own idempotency keys, wherever the table shows read and write.

| Capability | Xero | QuickBooks | NetSuite | Sage Intacct | FreshBooks | Wave |
| --- | --- | --- | --- | --- | --- | --- |
| Quotes | Read and write | Not available | Read and write | Not available | Not available | Read only |
| Invoices | Read and write | Read and write | Read and write | Read and write | Read and write | Read and write |
| Purchase orders | Read and write | Read and write | Read and write | Read only | Not available | Not available |

## When something goes wrong

### A supplier purchase order fails

The workflow retries with backoff and resumes at that purchase order. The invoice and the purchase orders already created are left alone.

### Retries run out

After the attempt limit, 8 by default, the operation moves to dead\_letter. It stays visible in the API and the console instead of failing silently.

### You fixed the cause and want to rerun

Replay the operation with a reason. The replay is written to the audit log and continues from the last completed step.

### Your queue request is sent twice

The Idempotency-Key returns the same operation instead of starting a second workflow.

## Limits to know first

-   The recipe runs on Xero only.
-   The invoice is created as a draft linked to the quote. Approving and sending it stays your decision.
-   Automations need a cached connection. Zero-retention connections support live reads only.

## Common questions

What happens if Xero fails halfway through the workflow?

Each completed step is saved. The workflow retries the failed step with backoff and continues from there, so a failure on the second purchase order does not create a second invoice or repeat the first purchase order.

Does the quote to invoice recipe work on QuickBooks Online or NetSuite?

No. The quote.accept\_and\_create\_invoice recipe runs on Xero. Quote writes are also available on NetSuite, and purchase order writes on QuickBooks Online and NetSuite, so you can make those calls individually with the same idempotency guarantees.

How do I see where a workflow stopped?

Read GET /v1/operations/{operation\_id}. It returns the state, the number of attempts, the attempt limit, and the error. The console shows the same record.

Am I billed for failed attempts?

No. An automation run is metered once, after it succeeds. Failed attempts do not create usage.

## Keep reading

[**Automations**Documentation](https://docs.accountingkit.dev/docs/automations) [**Operations and replay**Documentation](https://docs.accountingkit.dev/docs/operations) [**Xero integration**Documentation](https://docs.accountingkit.dev/docs/integrations/xero) [**Invoice sync**Write the invoices your product generates into each customer’s ledger and show paid status in your own UI.](https://accountingkit.dev/use-cases/invoice-sync/) [**Payment sync**Apply payments to open invoices and react when an invoice is paid, due soon, or overdue.](https://accountingkit.dev/use-cases/payment-sync/) [**All six accounting integrations**Resources, webhooks, and limits for each system.](https://accountingkit.dev/integrations/)

## Build it against a sandbox company today.

The test environment is free. Or tell us which accounting systems your customers run and we will map the coverage with you.

[Start free](https://app.accountingkit.dev/auth/login) [Talk to us](https://accountingkit.dev/contact/?topic=integration)
