Sync active Salesforce payment terms to Xero invoices daily
CRMMarketingRecipe ToolsDeveloper ToolAPI Integration
What it does
When a scheduled interval triggers, this automation searches Salesforce for opportunities with active payment terms, billing cycles, and dates. It creates invoices in Xero for each matching record so billing stays current without manual entry.
Who it's for
Accounting teams who need to generate Xero invoices from Salesforce payment terms on a daily schedule.
How teams use this
Automate daily invoice generation from Salesforce
Run the payment terms search every morning so Xero invoices are created without manual data entry. The team reviews the job report to confirm all records synced.
Expand sync to include suspended accounts
Add a condition to filter opportunities where account suspension dates fall outside the billing period so only active accounts generate invoices in Xero.
Route invoices by billing contact
Include a Rest step that sends each created Xero invoice to the billing contact email from the Salesforce work order so invoices reach the right recipient.
How it works
- Search for active payment terms daily. On a scheduled interval, query Salesforce for opportunities where Product, Billing Cycle, Billing Start Date, and Billing End Date are all present.
- Retrieve opportunity and work order details. For each matching opportunity, fetch the stage name, suspension dates, billing contact information, and account suspension dates from Salesforce work orders.
- Create invoices in Xero via Rest. Send the payment terms and billing details through Rest to Xero so invoices are created for each active payment term record.
- Log results to job report. Record the invoice creation outcomes and any errors to the job report so the team can verify the daily sync completed successfully.