ml-connector
PlexChargebee

Plex and Chargebee integration

Plex runs manufacturing finance and operations. Chargebee runs billing and subscription management. Connecting the two keeps your customer and invoice records in sync between your ERP and your billing system. New customers and sales in Plex flow to Chargebee as subscription records, and invoices can be created as billable events without manual entry. ml-connector handles the different APIs and schedules the sync on your terms.

How Plex works

Plex Cloud exposes customers, sales orders, invoices, parts, inventory, and GL accounts through REST JSON APIs at cloud.plex.com/api, authenticated with OAuth 2.0 client credentials. The platform also supports legacy SOAP Web Services with Basic auth and scheduled SFTP flat-file DataSources extracts for bulk historical loads. Plex does not offer native webhooks, so connectors must poll the REST API on a configurable interval filtering by modified_date and created_date, or pull batches from scheduled SFTP extracts. Role-based permissions are enforced in Plex, so the integration user must have the correct roles assigned or API calls return 403 or empty results.

How Chargebee works

Chargebee is a subscription billing platform that exposes customers, subscriptions, invoices, transactions, payment sources, and items through REST APIs over HTTPS at {site}.chargebee.com/api/v2/. Every API call uses HTTP Basic Auth with an API key as the username, and the platform returns JSON for all requests. Chargebee supports outbound webhooks for 200+ event types across customer, subscription, invoice, and payment categories with retries up to two days, but ml-connector typically writes directly to the API rather than waiting for a push. Rate limits vary by plan tier: Starter 150 req/min, Performance 1000 req/min, Enterprise 3500 req/min. Pagination is offset-based with a maximum page size of 100.

What moves between them

The main flow moves customer and sales order data from Plex into Chargebee. As customers are added or modified in Plex, ml-connector reads them on a polling schedule and creates or updates Chargebee customer records. Sales orders in Plex can flow into Chargebee as invoices or subscription line items, depending on your billing model. Invoice data from Plex sales orders is mapped to Chargebee invoices for payment tracking. The sync runs on a schedule you define (typically daily or weekly) and tracks which records have already been synced so duplicates are not created.

How ml-connector handles it

ml-connector stores the Plex OAuth2 credentials encrypted and refreshes the bearer token when API calls return 401, handling token expiry transparently. On the Plex side, it polls the REST API filtering by modified_date to catch new and changed records since the last run, and also accepts SFTP DataSources extracts for bulk historical loads. Because Plex enforces role-based permissions, the integration user must have the correct Plex roles assigned in advance. On the Chargebee side, ml-connector uses HTTP Basic Auth with the API key and respects Chargebee's rate limits per plan tier, backing off and retrying when it encounters HTTP 429. Customer records are matched by email or Plex reference ID to avoid creating duplicate Chargebee customers, and sales orders are mapped to Chargebee invoices with line items preserving the part descriptions and amounts from Plex. Every record carries a jobId for deduplication, so if a write to Chargebee fails and is retried under the same jobId, it does not create a duplicate invoice or duplicate line item.

A real-world example

A mid-sized discrete manufacturer runs Plex ERP for production, procurement, and financials across multiple plants. They also run Chargebee for subscription billing to managed-service customers who pay a recurring fee based on monthly volume. Before the integration, the finance team exported customer lists and monthly invoice totals from Plex into a spreadsheet each month and manually entered them into Chargebee to generate billing. Invoicing lagged by days, and errors in manual re-entry caused payment disputes. With Plex and Chargebee connected, customer records sync automatically when they are added or modified in Plex, and each month's sales invoices flow into Chargebee as billable records without re-keying. The billing team sees accurate data on time, and reconciliation between the two systems is automatic.

What you can do

  • Sync customers from Plex to Chargebee on a configurable polling schedule, matching by email or reference ID to avoid duplicates.
  • Map Plex sales orders and invoices into Chargebee billable events or subscription line items, preserving amounts and descriptions.
  • Handle Plex OAuth2 token refresh transparently and respect Chargebee rate limits per plan tier with exponential backoff.
  • Maintain a full audit trail of every customer and invoice record synced, with jobId-based deduplication for safe retries.
  • Accept SFTP DataSources extracts from Plex for bulk historical loads in addition to REST API polling.

Questions

Which direction does data move between Plex and Chargebee?
The main flow is Plex into Chargebee. Customer and invoice records move from Plex into Chargebee as subscription and billing records. Plex is the source of truth for customers and sales transactions, and Chargebee is the billing platform that generates and sends invoices to customers. ml-connector does not write customer or invoice data back to Plex.
How does ml-connector handle the different authentication schemes between Plex and Chargebee?
ml-connector stores both credential sets encrypted. For Plex, it uses OAuth2 client credentials, refreshing the bearer token when API calls return 401 to handle token expiry transparently. For Chargebee, it uses HTTP Basic Auth with the API key as the username and an empty password, encoding them in the Authorization header per Chargebee's requirement. Each system's credentials are rotated independently.
How often does the sync run, and how does ml-connector avoid creating duplicate customers or invoices?
The sync runs on a schedule you define, typically daily or weekly. ml-connector matches Plex customers by email or Plex reference ID to avoid creating duplicate Chargebee customer records. Sales orders and invoices are tracked with a jobId for deduplication, so if a write fails and is retried under the same jobId, Chargebee does not create a duplicate invoice or line item. Retries are automatic with backoff.

Related integrations

Connect Plex and Chargebee

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

Get started