---
title: "How to Build AI Sales Forecasting Using CRM and Billing Data"
img: https://s3.us-east-2.amazonaws.com/unified-article-images/how_to_build_ai_sales_forecasting_using_crm_and_billing_data-icon.png
date: 2026-03-24T00:30:00.000Z
tag: Product
description: "AI sales forecasting is a feature inside a SaaS product that predicts future revenue using CRM pipeline data and billing signals. It combines deal activity..."
url: "https://unified.to/blog/how_to_build_ai_sales_forecasting_using_crm_and_billing_data"
---

# How to Build AI Sales Forecasting Using CRM and Billing Data
------
_March 24, 2026_

AI sales forecasting is a feature inside a SaaS product that predicts future revenue using CRM pipeline data and billing signals. It combines deal activity from systems like Salesforce or HubSpot with subscription and payment data from platforms like Stripe to produce more accurate forecasts.


To build this, your product needs access to both pipeline data and revenue data. CRM systems track deals and their progression, while billing platforms track subscriptions and payments. Each system has different APIs and schemas.


Unified provides category-specific APIs for CRM and Payments, allowing your product to retrieve pipeline and billing data through consistent objects. This makes it possible to build forecasting features without maintaining separate integrations for each provider.


## Why SaaS Products Build AI Sales Forecasting Features


Many B2B SaaS products include forecasting capabilities for their customers.


Examples include:

- Revenue intelligence platforms
- Sales analytics tools
- RevOps dashboards
- Customer success platforms
- AI sales assistants

These products help teams answer questions like:

- 'What revenue will close this quarter?'
- 'Which deals are most likely to close?'
- 'How does pipeline compare to actual revenue?'

Without combining CRM and billing data, forecasts are incomplete or inaccurate.


## Common AI Sales Forecasting Use Cases


AI forecasting features typically support several workflows.


**Revenue prediction**


Estimate future revenue based on pipeline and historical performance.


**Deal forecasting**


Predict the likelihood of deals closing.


**Pipeline analytics**


Analyze deal stages, velocity, and conversion rates.


**Forecast vs actual comparison**


Compare expected revenue with billing data.


**Risk detection**


Identify deals or accounts that may not close.


## Unified Categories Used


AI sales forecasting combines data from two categories.


| Category | Description                                                          | Key Objects                   |
| -------- | -------------------------------------------------------------------- | ----------------------------- |
| CRM      | Pipeline and account data from platforms like Salesforce and HubSpot | contact, company, deal, event |
| Payments | Subscription and transaction data from platforms like Stripe         | payment, subscription         |
These categories provide the inputs needed for forecasting.


## Unified Objects and Key Fields


### CRM Objects


CRM data provides pipeline and deal context.


| Object  | Key Fields                                | Purpose                   |
| ------- | ----------------------------------------- | ------------------------- |
| Deal    | amount, probability, stage_id, closing_at | Forecast pipeline revenue |
| Contact | name, emails                              | Customer identity         |
| Company | name, domains                             | Account grouping          |
| Event   | type, created_at                          | Activity history          |
Important fields for forecasting:

- `amount` – deal value
- `probability` – likelihood of closing
- `closing_at` – expected close date
- `stage_id` – pipeline stage

These fields allow your product to estimate expected revenue.


### Payments Objects


Billing data provides actual revenue signals.


| Object       | Key Fields                              | Purpose           |
| ------------ | --------------------------------------- | ----------------- |
| Payment      | total_amount, currency, contact_id      | Cash collected    |
| Subscription | status, current_period_end_at, interval | Recurring revenue |
Important subscription fields include:

- `status` – active, canceled, paused
- `current_period_start_at` / `current_period_end_at` – billing cycle
- `interval` / `interval_unit` – billing frequency
- `lineitems` – pricing details

These fields allow your product to calculate recurring revenue.


## Mapping Data to Forecast Metrics


Forecasting models combine CRM and billing signals.


**Pipeline value**


```plain text
weighted_pipeline = deal.amount * deal.probability
```


Estimates expected revenue based on deal probability.


**Projected revenue**


```plain text
projected_revenue = sum(weighted_pipeline by closing_at period)
```


Forecasts revenue by time period.


**Actual revenue**


```plain text
actual_revenue = sum(payment.total_amount)
```


Tracks collected revenue.


**Recurring revenue**


```plain text
MRR = sum(active subscription monthly value)
ARR = MRR * 12
```


Measures predictable revenue streams.


Combining these metrics allows your product to compare forecasted vs actual performance.


## Connecting Customer Data Sources


Customers connect their CRM and billing platforms using Unified Connect.


Typical process:

1. Your application launches the authorization flow.
2. The user selects integrations such as Salesforce, HubSpot, or Stripe.
3. The user authorizes access.
4. Unified returns a **connection_id**.

Your application stores:


```plain text
user_id → connection_id
```


All API requests reference this identifier.


## Retrieving CRM and Billing Data


Your application retrieves data using Unified endpoints.


CRM:


```plain text
GET /crm/{connection_id}/deal
GET /crm/{connection_id}/contact
GET /crm/{connection_id}/company
GET /crm/{connection_id}/event
```


Payments:


```plain text
GET /payment/{connection_id}/payment
GET /payment/{connection_id}/subscription
```


These endpoints return normalized objects across providers.


Common filters include:

- `updated_gte` for incremental updates
- `contact_id` for linking revenue to accounts

## Building an AI Forecasting Pipeline


AI forecasting features typically follow this pattern.


**1. Retrieve data**


Fetch deals, payments, and subscriptions.


**2. Aggregate metrics**


Calculate pipeline, revenue, and activity metrics.


**3. Train or apply models**


Use historical data to predict outcomes.


**4. Generate forecasts**


Estimate revenue for future periods.


**5. Store results**


Persist forecasts in your application.


**6. Display insights**


Show forecasts in dashboards or reports.


This pipeline allows your product to deliver predictive insights.


## Generating AI Forecast Insights


AI models can generate explanations alongside forecasts.


Example prompt:


```plain text
{
  "messages": [
    { "role": "system", "content": "You are a sales forecasting assistant." },
    { "role": "user", "content": "Explain why revenue is projected to decline next quarter." }
  ]
}
```


The model can produce:

- forecast summaries
- risk explanations
- recommendations

This helps users understand not just the forecast, but the reasoning behind it.


## Keeping Forecast Data Updated


Forecasts must reflect current data.


Unified supports updates across categories:

- deal updates
- activity changes
- subscription updates
- payment events

Applications can use webhook events or timestamps such as `updated_at` to trigger recalculation.


## Supported Platforms


Unified supports a broad range of integrations.


CRM (47+ integrations)

- Salesforce
- HubSpot
- Pipedrive
- Zoho CRM

Payments (16 integrations)

- Stripe
- PayPal
- Square

This allows forecasting tools to support many customer environments.


## Why This Matters


AI sales forecasting requires combining pipeline data and revenue data.


Without unified integration infrastructure, developers must build and maintain separate integrations for CRM and billing platforms.


Unified provides:

- consistent objects across CRM and payments categories
- real-time access to source data
- unified authentication
- simplified data retrieval

This allows product teams to build forecasting features that provide accurate revenue predictions and actionable insights.


Start building AI sales forecasting across CRM and billing platforms today. 


→ [Start your 30-day free trial](https://app.unified.to/login)


→ [Book a demo](https://calendly.com/d/cph9-g8n-jzg/connect-with-unified)