ml-connector
Sage X3Chargebee

Sage X3 and Chargebee integration

Sage X3 runs finance and operations. Chargebee runs subscription billing and revenue recognition. Connecting the two keeps your ERP in sync with your subscription lifecycle and billing outcomes. New subscription starts and price changes in Chargebee automatically flow into Sage X3 as sales orders, and monthly invoice totals are posted to your GL accounts without re-keying. ml-connector bridges two very different APIs and moves the data on a schedule that matches your billing calendar.

How Sage X3 works

Sage X3 is an on-premise and cloud ERP that exposes suppliers, customers, sales and purchase orders, invoices, and GL entries through REST api1 (legacy with HTTP Basic Auth or OAuth2) or GraphQL Xtrem (OAuth2, recommended for V12+). Access tokens expire in 5 minutes with 30-day refresh tokens. Sage X3 does not support outbound webhooks or native push events, so records are read by polling the updatedDate field to detect changes since the last sync. On-premise is the dominant deployment model, and each customer instance has a unique server URL, port, and folder name. REST api1 defaults to 20 records per page, and analytical dimensions on GL entries vary per customer configuration.

How Chargebee works

Chargebee is a SaaS billing platform that handles recurring billing, invoicing, and payment processing for subscription businesses. It exposes customers, subscriptions, invoices, credit notes, transactions, and payment sources via REST endpoints at https://{site}.chargebee.com/api/v2/ (with regional variants). Authentication uses HTTP Basic Auth with an API key. Chargebee pushes events to registered webhook endpoints for over 200 event types, including customer creation, subscription changes, and invoice generation. Rate limits depend on plan tier, ranging from 150 to 3500 requests per minute, and the webhook delivery system retries up to 2 days with increasing delays if an endpoint is unreachable.

What moves between them

The main flow is bidirectional. When a new subscription is created or updated in Chargebee, ml-connector reads the subscription details and customer record from Chargebee and creates a matching sales order in Sage X3. When Chargebee generates a monthly invoice, ml-connector receives the webhook notification, reads the full invoice and line-item details, and posts a revenue GL entry in Sage X3 mapped to the customer's GL account and revenue dimension. GL entries are reconciled by month to match Chargebee's billing period, and customer master data is kept in sync on both sides so invoices land on valid customer accounts in the ERP.

How ml-connector handles it

ml-connector stores Sage X3 server URL, port, and folder name as customer-specific settings, and authenticates with OAuth2 bearer tokens or basic auth depending on the deployment (cloud uses OAuth2, on-premise may use basic auth). On the Chargebee side, it stores the API key encrypted and authenticates every request with HTTP Basic Auth. When Chargebee webhooks for invoice events arrive, ml-connector extracts the invoice ID and re-fetches the full invoice and line items from the Chargebee API to verify the data before posting to Sage X3. If the GL account for the customer does not exist in X3, the record is queued for retry and an alert is sent. Chargebee rate limits return 429 responses per plan tier, so ml-connector backs off and retries with exponential jitter. Access token refresh happens automatically before expiry, and every record carries an audit log entry including the webhook event ID or the poll timestamp, so invoices can be replayed if a downstream GL post fails.

A real-world example

A B2B SaaS company with a $2M annual recurring revenue uses Chargebee to manage subscriptions across 200 customers with tiered pricing and annual commitments. Finance uses Sage X3 on-premise for GL accounting and customer accounting. Before the integration, the billing team exported invoice reports from Chargebee on the last day of each month, split revenue by customer and product tier, and manually entered the totals into Sage X3 as journal entries, a process that took two days and was prone to entry errors. With Sage X3 and Chargebee connected, each invoice posts automatically to the GL within minutes of generation, mapped to the correct customer and revenue account, and reconciliation is instant. The finance team now spends month-end close validating automated entries instead of re-keying billing data.

What you can do

  • Sync new subscriptions and subscription updates from Chargebee to Sage X3 as sales orders with customer and pricing details.
  • Post Chargebee monthly invoices to Sage X3 GL accounts with customer and revenue dimension mapping, without re-entry.
  • Receive Chargebee invoice and subscription webhook events in near real time and queue them for GL posting on a schedule that matches your month-end close.
  • Authenticate Sage X3 with OAuth2 tokens (cloud) or basic auth (on-premise), and Chargebee with HTTP Basic Auth, with automatic token refresh and full encryption.
  • Track record lineage with audit logs and invoice replay so GL entries can be corrected if a downstream GL post fails or a subscription update is reversed.

Questions

Which direction does data move between Sage X3 and Chargebee?
The main flow is Chargebee to Sage X3. Subscription records and invoices flow from Chargebee into X3 as sales orders and GL postings. Customer master data is kept in sync in both directions so invoices land on valid customer accounts in the ERP.
How does ml-connector handle Sage X3's lack of native webhooks?
Sage X3 does not support outbound webhooks or push events. ml-connector polls Sage X3 for customer and order changes using the updatedDate field to detect deltas since the last poll. This cadence is tied to your billing calendar so revenue postings do not lag month-end.
What happens if Chargebee's rate limit is exceeded or the GL account does not exist in Sage X3?
If Chargebee returns HTTP 429, ml-connector backs off and retries with exponential jitter. If the GL account for a customer does not exist in X3, the invoice is queued for retry and an alert is sent to your team so the account can be created before reconciliation.

Related integrations

Connect Sage X3 and Chargebee

Free to use. Add your credentials, ping your real systems, and see if we fit.

Get started