Add Chargebee customers to Close
A Chargebee + Close agent flow
A subscription business closes a deal and the new account shows up in Chargebee the moment billing starts. The sales team running Close, who should be expanding and renewing that account, often don't have it as a lead yet. This recipe carries new Chargebee customers into Close as leads, so the people responsible for the relationship have a record to work from. Your agent reads recent customers, then creates a Close lead per company with create_lead, carrying the name and a note with the Chargebee customer ID. Chargebee's server answers calls rather than streaming events, so the agent runs on a schedule, hourly or daily, and only customers it hasn't filed become leads. The CRM grows alongside the billing system instead of lagging it.
The flow
List customersList customers on the account with filtering and pagination.
create_leadCreates a new lead (company).
Step by step
- Define new and where it lands
Tell the agent how to spot a new customer, for instance created since the last run, and that each maps to a Close lead. Decide whether you also attach a contact for the billing email.
- Read recent customers
The agent calls the List customers tool with a filter and pagination, reading each customer's company name, billing email, and Chargebee ID.
- Create the lead
For each new customer it calls create_lead with the company name, then optionally create_contact for the primary email, and a create_note holding the Chargebee customer ID so the lead traces back to billing.
- Dedup before creating
Have the agent search Close for an existing lead by name or by the stored Chargebee ID first. Found means skip or update; not found means create, so a returning customer doesn't get a second lead.
Tell your agent
Every hour, list Chargebee customers created since the last run. For each one, search Close for an existing lead by company name; if none exists, create a lead with that name, add a contact for the billing email, and attach a note with the Chargebee customer ID. Skip customers already in Close.
Setup
This flow needs both servers connected to your agent. Follow each install guide:
Worth knowing
- In Close, create_lead makes a company. A person is a separate create_contact attached to that lead, so a 'customer' usually becomes one lead plus one contact, not a single record.
- Several Chargebee customer-read tools have spaces in their names, like 'List customers' and 'Find customers by email'. Pass the name exactly as the server exposes it.
- The List customers tool paginates and filters. Track the last customer you handled or filter by created time, so each run reads only new customers rather than the whole account.
Questions
- Why mirror billing into the CRM?
- So sales works from reality. When a paying customer exists as a Close lead with the billing context attached, renewals and expansion start from a record the team can act on, instead of someone noticing the account in Chargebee later.
- How does it avoid duplicate leads?
- By searching Close first, on company name or the Chargebee customer ID you store in a note. If a lead is already there, the agent skips creation or updates it; only genuinely new customers get a fresh lead.
- Can it act the instant a customer signs up?
- No. Chargebee's server responds to the agent's call rather than pushing, so the CRM trails new customers by your polling interval. Run it more often if sales needs the lead sooner.