Skip to content

How to build a quote-to-order integration

A quote is approved at a discount nobody records, signed in a tool nobody reads, and booked at a figure that matches neither. The shape of a quote-to-order flow that holds together, and the prompts that build it.

Last reviewed September 2026

Integration, built with Tray Headless

The short answer

What is quote-to-order?

Quote-to-order comes down to four things: an approval state that travels with the quote rather than living in an email thread, a signature event that is the trigger instead of something somebody checks, a booking that matches the signed document exactly, and amendments treated as first-class rather than as a new deal. Where this usually goes wrong is amendments. A mid-term upgrade handled as a fresh quote produces two contracts for one customer and a renewal nobody can calculate.

Stage 2 of 8: Contract, approval and signature. Part of Order-to-cash, end to end: every stage, the systems it runs on and the guide that builds it.

The flow: Salesforce CPQ, then Approval state, then DocuSign, then Compare to signed, then Booked order, then NetSuite. Salesforce CPQ System Approval state Step DocuSign System Compare to signed Step Booked order Step NetSuite System
Approval travels with the quote, and the booking is compared to the signed document before it is accepted.

What matters here

  • The approved discount must travel on the record. An approval that lives in a Slack thread cannot be audited or enforced.
  • Signature is an event, not a status somebody checks. Book on the webhook, not on a nightly scan of a signing tool.
  • What gets booked must match what was signed, line for line. If they differ, stop rather than reconciling.
  • Treat an amendment as an amendment. A mid-term change filed as a new quote breaks the renewal calculation permanently.
  • Carry the quote id all the way through. Without it nobody can trace a booked figure back to the approval that allowed it.

Who this is for

You run revenue operations or deal desk. Quotes are approved in one place, signed in another and booked in a third, and reconciling the three at quarter end is somebody's week.

How it works in practice

Everything that sits between a rep building a quote and revenue being booked.

  1. 1

    Approval state is written onto the quote

    Who approved, at what discount, against which policy, and when. Not an email thread.

  2. 2

    The signature request carries the approved version

    So the document sent is provably the one that was approved, not a later edit.

  3. 3

    Signature fires a webhook and booking begins

    Event-driven, because a nightly scan means a Friday signature books on Monday.

  4. 4

    The booking is compared to the signed document

    Line for line. A mismatch stops the process instead of being resolved by whichever system wrote last.

  5. 5

    The quote id travels to the order and the invoice

    So a booked figure traces back to the approval that permitted it.

  6. 6

    Amendments reference the original

    A mid-term change is an amendment with a link, never a fresh contract that orphans the renewal.

What quote-to-order is made of

Quote-to-order spans three systems and one commercial commitment. It is four parts.

Portable approval state

The approver, the discount, the policy and the timestamp, written on the quote itself so it survives the handoff.

A signature trigger

A webhook from the signing tool, not a status field somebody refreshes. Same-day booking depends on it.

An exact booking

What is booked equals what was signed. A difference is a stop condition, not something to average out.

Amendments as first-class

Upgrades, downgrades and co-terms link to the original contract, because the renewal figure is derived from the chain.

The Tray Headless prompts

Paste these into Claude Code or Codex with the Tray Headless plugin installed. Each stage runs on its own. The systems named in them are the worked example rather than a requirement, and every prompt says so.

Once per project, run /tray-workflows:set-workspace to pick the workspace these build in. Point it at a sandbox first.

1

Set up, then map the three systems

Quote, signature and booking each hold part of the truth.

  • build-workflow
Claude Code or Codex

Use build-workflow. The systems in play are Salesforce CPQ, DocuSign and NetSuite, or whatever we run in those seats.

I need SBQQ__Quote__c and SBQQ__QuoteLine__c with whichever fields hold approval state, the DocuSign envelope and what its Connect webhook actually sends on completion, and NetSuite SalesOrder and the contract record on the ERP side.

Show me where a discount is stored in each. They will not agree, and that disagreement is the integration.

2

Make the approval travel with the quote

An approval in an email thread cannot be enforced or audited.

  • build-workflow
Claude Code or Codex

Use build-workflow. When a quote is approved, write onto the quote record: the approver, the approved discount percentage, the policy threshold it was tested against, the justification, and the timestamp.

Then lock the approved version. If any line item, quantity or price changes after approval, revoke the approval and require it again. A quote that can be edited after approval is not an approved quote.

Never let the integration approve anything itself. It records and it enforces, it does not decide.

3

Trigger on signature, and book exactly what was signed

The comparison that stops a customer being invoiced for something else.

Claude Code or Codex

Trigger booking on the DocuSign envelope completed webhook, not on a scheduled scan. A Friday signature should book on Friday.

Then compare, line for line, before writing anything to the ERP:

Every product on the signed document appears on the order

Quantities match exactly

Prices match the approved discount, to the cent

Term dates match

The total matches

Any difference stops the process and raises it to the deal desk. Do not reconcile a mismatch automatically. The signed document is the contract, and an integration quietly adjusting it is how a customer receives an invoice they did not agree to.

This comparison is the whole control. Without it, an edit made between approval and signature books silently and is found at renewal.
4

Handle amendments as amendments

Where most quote-to-order implementations quietly break.

  • tray-gotchas
Claude Code or Codex

Use tray-gotchas, then handle the amendment cases:

Mid-term upgrade. Create an amendment linked to the original contract, co-terminated to the same end date, prorated from the effective date. Never a fresh contract.

Downgrade. Same linkage, and flag it for revenue recognition rather than processing it silently.

Renewal. Reference the expiring contract so the renewal figure derives from the chain, including every amendment along the way.

Cancellation within a cooling-off period. Reverse the booking and record why, rather than leaving a booked order nobody will invoice.

A mid-term change filed as a new deal produces two contracts for one customer, and the renewal number is wrong from that point on.

5

Carry the ids, and reconcile the chain

So a booked figure can be traced back to the approval that allowed it.

Claude Code or Codex

Stamp the quote id on the envelope, the order and the invoice, and the contract id on every amendment.

Then reconcile weekly across the chain:

Signed envelopes with no booked order

Booked orders with no signed envelope

Bookings where the discount exceeds what was approved

Amendments with no parent contract

Report days from approval to signature, signature to booking, and the count of mismatches caught. If mismatches are frequent, the problem is upstream in quoting rather than here.

6

Prove it works, then hand it to deal desk

Because approval thresholds change with the comp plan.

Claude Code or Codex

Run the per-step schema checks and the whole-workflow audit before this touches production.

Then open the same workflow in Tray Build so the deal desk can adjust approval thresholds and the mismatch tolerance in the visual canvas. Those move with the comp plan, and they should not need a coding assistant.

What it connects to

Three systems hold one commercial agreement between them.

Named systems are the ones most teams run, not the only ones that work. Each is an authentication in your Tray workspace, referenced by name, so the workflow never holds a credential.

Same build, other stacks

The design does not change if you run something else in one of these seats. The same prompts build it against Microsoft Dynamics 365, SAP S/4HANA, Google BigQuery, Microsoft Teams, HubSpot or Oracle.

Connections in this build

Field mapping, templates and common problems for each pairing: DocuSign + Salesforce, NetSuite + Salesforce, DocuSign + NetSuite and Salesforce + Slack.

Running it in production

This moves a signed commercial commitment into a financial system. It is audited every quarter.

  1. 1

    It runs where production runs, not on a laptop

    Signature webhooks arrive when they arrive, including at the end of a quarter. They are handled on the platform with retries rather than by an endpoint somebody maintains.

  2. 2

    The chain is traceable end to end

    Quote to envelope to order to invoice, with ids carried through and an audit trail behind each write.

  3. 3

    Credentials live in the workspace, never in the repo

    Three systems and three authentications, each scoped separately. The signing tool credential in particular should not be able to do anything else.

  4. 4

    Deal desk owns the thresholds

    Approval limits and mismatch tolerance open in Tray Build, adjusted by the team that owns discount policy.

  5. 5

    A mismatch stops the line

    It does not warn and continue. A booking that differs from the signed document is a customer-facing error waiting to happen.

Build it as an app with Tray Helix

This moves the data between systems. It does not give anybody a screen to work in. Build that app in Claude Code, Codex or Cursor, then deploy and run it governed on Tray Helix. Same kind of guide, same kind of prompts.

Further reading

Background on the same subject, for the case rather than the build.

Questions people ask

Where does this stop and order-to-cash begin?

This one ends at a booked order: approval on the quote, signature, and a booking checked against the signed document. Everything after the order exists, the invoice and the payment against it, is order-to-cash. The two meet at the order and do not overlap.

Why must approval state live on the quote?

Because an approval in an email or a Slack thread cannot be enforced or audited. Writing the approver, the discount and the policy onto the record is what lets the booking step check it.

What if the booking does not match the signature?

Stop and raise it, and reconcile nothing automatically. The signed document is the contract, and an integration quietly adjusting a price is how a customer receives an invoice they never agreed to.

Why are amendments treated separately?

Because a mid-term upgrade filed as a new quote creates a second contract for one customer. The renewal figure is derived from the contract chain, and it is wrong from that point onward.

Should booking run on a schedule?

No. Trigger on the signature webhook. A nightly scan means a Friday signature books on Monday, and that delay is visible to the customer and to the forecast.

Can deal desk change approval thresholds themselves?

Yes. Thresholds and mismatch tolerance open in Tray Build, so the team that owns discount policy owns the settings that enforce it.

See it working for your business.

Bring your stack and your ideas. See what's possible.

Great, a couple more details

This helps us connect you with the right person. Optional, and you can skip it.