Skip to content

How to build a billing to CRM sync

A rep opens a renewal call with a customer ninety days overdue, and nobody told them. How billing data reaches the account team, the prompts that build it, and what production adds.

Last reviewed September 2026

Integration, built with Tray Headless

The short answer

What is a billing to CRM sync?

A billing to CRM sync is four parts: a one-way flow that treats billing as the source of truth, a summary on the account instead of every transaction copied across, derived signals like days overdue and payment behavior instead of raw balances, and a refresh cadence matched to how fast the data actually changes. What sinks most attempts is copying everything. A CRM holding every invoice line becomes a second billing system that disagrees with the first one within a month.

Stage 5 of 6: Billing and payments. Part of ERP integration, end to end: every stage, the systems it runs on and the guide that builds it.

The flow: NetSuite, then Summarize per account, then Derive signals, then Salesforce, then Alert on combination. NetSuite System Summarize per account Step Derive signals Step Salesforce System Alert on combination Also
One direction only. Billing is the source of truth and the CRM displays a read-only summary.

What matters here

  • Billing is the source of truth and the CRM is a reader. Two-way sync on financial data produces two versions of the balance.
  • Summarize, not copy. Total outstanding, oldest invoice age and payment behavior beat a list of every transaction.
  • Derive the signals people act on. Days overdue and average days to pay change a renewal conversation; a balance figure does not.
  • Match the cadence to the data. Payment state changes daily, contract terms change quarterly, and syncing both hourly is waste.
  • Never let the CRM write back to billing. A rep adjusting an invoice from an opportunity screen is how the ledger goes wrong.

Who this is for

You run revenue operations or customer success systems. Renewal and expansion conversations happen without any visibility of whether the customer pays on time, and finding out means asking finance.

How it works in practice

The path from an invoice changing state to a rep knowing about it.

  1. 1

    Billing events are read on a schedule that fits

    Payment state daily, contract terms weekly. Not everything at the same interval because one thing needed it.

  2. 2

    The data is summarized per account, not copied

    One roll-up per account, not a transaction table the CRM was never designed to hold.

  3. 3

    Signals are derived from the raw figures

    Days overdue, average days to pay, payment method risk, trend against the last two quarters.

  4. 4

    The summary is written to the account, read-only

    Visible on the record where renewal and expansion conversations happen, and not editable there.

  5. 5

    Thresholds raise a flag, not a number

    Ninety days overdue on a renewal in the next quarter is an alert, not a field somebody might notice.

  6. 6

    Nothing flows back to billing

    The CRM reads. A correction happens in the billing system by somebody who is allowed to make it.

What the sync is made of

One direction, one summary, and the discipline not to rebuild billing inside the CRM.

A one-way flow

Billing is authoritative. The CRM displays. Two-way financial sync produces two balances and an argument about which is right.

A summary, not a copy

Outstanding total, oldest invoice, last payment, next invoice date. Not every line item ever raised.

Derived signals

Days overdue, average days to pay, whether payment behavior is worsening. The figures a rep can actually act on.

A cadence per data type

Payment state changes daily. Contract terms do not. Syncing both on the same schedule wastes calls and hides the change that mattered.

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 and decide what actually needs to cross

Most billing to CRM projects fail by copying too much.

  • build-workflow
Claude Code or Codex

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

From NetSuite I need Invoice, CustomerPayment and CreditMemo, plus the subscription terms on the Customer record. From Salesforce I need Account and whichever custom fields already hold financial data, because there are usually two of them and they disagree.

Then help me decide what genuinely needs to cross. The default should be nothing, and each field has to earn its place by changing a conversation somebody actually has.

2

Summarize per account, and keep it read-only

The rule that stops the CRM becoming a second ledger.

  • build-workflow
Claude Code or Codex

Use build-workflow. Compute one summary per account rather than copying transactions:

Total outstanding, and how much of it is overdue

Oldest unpaid invoice and its age in days

Last payment amount and date

Next invoice date and amount

Average days to pay over the last four invoices

Current subscription value and term end

Write these to read-only fields on the Account. Set field-level security so nobody can edit them in the CRM, because a rep correcting a balance in Salesforce creates a number that disagrees with the ledger and is believed by the next person who reads it.

3

Derive the signals people act on

A balance is data. Days overdue is a reason to pick up the phone.

Claude Code or Codex

Raw figures do not change behavior. Derive:

Payment health: on time, occasionally late, consistently late,

currently overdue. Computed over the last four invoices, not one.

Trend: is average days to pay improving or worsening against the

previous two quarters.

Renewal risk overlay: an account overdue beyond a threshold with a

renewal inside the next quarter. That combination is the single most

useful thing this sync produces.

Payment method risk: a card expiring before the next invoice date,

which is a preventable failure and nobody looks for it.

Put payment health on the account as a labeled state, not a number. A rep scanning a list reads a label; they skip a figure.

The renewal risk overlay is the reason to build this. Everything else is context; that one changes who gets called this week.
4

Match the cadence to the data, and handle the edges

Because syncing everything hourly hides the change that mattered.

  • tray-gotchas
Claude Code or Codex

Use tray-gotchas, then set cadences separately:

Payment and invoice state daily

Subscription terms weekly

Anything overdue crossing a threshold immediately

Handle these explicitly:

A credit note that clears a balance should clear the overdue flag in

the same run, not the next one.

A disputed invoice is not the same as an unpaid one. Read the dispute

flag and label it differently, because calling a customer overdue on an

invoice they have queried damages the relationship.

Partial payments reduce the outstanding figure without clearing the

age of the oldest invoice.

An account with no billing record at all is a state, not an error.

Show it as not yet billed instead of as zero outstanding.

5

Alert on the combination, not the field

Nobody reads a field. People read an alert about a deal.

Claude Code or Codex

Write no alert for a number changing. Alert on combinations that mean something:

Overdue beyond the threshold with a renewal in the next quarter

Payment health moving from on time to consistently late

A failed payment on an account with an open expansion opportunity

A card expiring before the next invoice on an account above a value

Send each to the account owner and to customer success, not to a shared finance channel where the account team never looks.

Then report monthly: how often a renewal was worked on an account with an overdue balance nobody had flagged. That number is what this sync exists to reduce.

6

Validate, then hand the thresholds over

Because what counts as overdue is a commercial policy.

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 revenue operations can adjust the overdue thresholds, the payment health bands and the alert rules in the visual canvas. Those are commercial policy, and they change.

What it connects to

One system holds the money, another holds the relationship, and the flow runs one way.

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: NetSuite + Salesforce, NetSuite + Stripe, Stripe + Salesforce and Salesforce + Slack.

Running it in production

This puts financial data in front of the commercial team. Accuracy and direction both matter.

  1. 1

    The platform runs it, not a laptop under a desk

    Daily and weekly cadences run independently on the same engine, so a slow billing export does not delay the payment state everybody reads.

  2. 2

    The direction is enforced, not only intended

    Read from billing, write to the CRM, never the reverse. That constraint is what keeps one balance, not two.

  3. 3

    Managed credentials, not secrets in a config file

    The billing credential is read-only by design and lives in your workspace. This workflow should be incapable of changing a ledger.

  4. 4

    RevOps owns the thresholds

    Overdue bands, payment health definitions and alert rules open in Tray Build, because they are commercial policy instead of engineering settings.

  5. 5

    Staleness is visible

    Stamp the last successful sync on the account. A payment health label that silently stopped updating is worse than no label.

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

Why one-way, not bidirectional?

Because two-way sync on financial data produces two versions of the balance, and the CRM version gets believed. Billing is the source of truth and the CRM is a reader.

Why summarize instead of copying every invoice?

Because a CRM holding every transaction becomes a second billing system that disagrees with the first within a month. A roll-up per account carries what a rep needs and nothing they will misread.

What is the most useful signal?

An account overdue beyond the threshold with a renewal inside the next quarter. That combination is the reason to build this; everything else is context.

How often should it sync?

By data type. Payment state daily, subscription terms weekly, and anything crossing an overdue threshold immediately. One interval for everything wastes calls and delays the thing that mattered.

Should a rep be able to correct a balance in the CRM?

No. Set field-level security so the summary is read-only. A corrected figure in Salesforce disagrees with the ledger and is believed by whoever reads it next.

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.