ml-connector
Sage X3PayPal

Sage X3 and PayPal integration

Sage X3 handles your company's finance and procurement. PayPal handles your customer payments and settlements. Connecting the two keeps your accounts receivable and general ledger in agreement with what PayPal processed and settled. Customer orders and payments flow into Sage X3 mapped to the correct sales and GL accounts, refunds post automatically, and reconciliation at month end matches your bank deposits to your Sage X3 cash receipts without manual lookup.

How Sage X3 works

Sage X3 exposes suppliers, customers, purchase orders, sales invoices, GL accounts, and GL entries through REST (api1), GraphQL (Xtrem), or SOAP depending on version and deployment model. Authentication uses OAuth2 client credentials via Connected Application for GraphQL, or HTTP Basic Authentication for the legacy REST api1 endpoint. Server URL, port, and folder names are customer-specific with no central registry. Sage X3 does not support outbound webhooks, so payment and invoice records are read by polling against the updatedDate or modifiedDateTime fields to detect changes.

How PayPal works

PayPal exposes orders, payments, invoices, transactions, refunds, and subscriptions through REST APIs with OAuth2 bearer token authentication. Every call requires a token obtained via client credentials from the Developer Dashboard, and tokens expire in approximately 8 hours. PayPal can push events via registered webhooks using HTTPS POST with RSA-SHA256 signature verification on the payload. Transaction search is limited to a 31-day window, and results are capped at 500 per page. PayPal has no native GL account or supplier registry, so transactions must reconcile against Sage X3 customer dimensions.

What moves between them

The main flow runs from PayPal into Sage X3. When a customer payment is captured and settled in PayPal, ml-connector receives the webhook notification, looks up the matching Sage X3 customer and GL account, and records a sales receipt or invoice payment in Sage X3's accounts receivable ledger and general ledger. PayPal settlement transactions flow into Sage X3's cash receipts so bank reconciliation matches. Refunds and chargebacks flow back to reverse the sales transaction. Reference data such as customer IDs are aligned so PayPal order metadata carries the matching Sage X3 customer number.

How ml-connector handles it

ml-connector stores PayPal client credentials encrypted and requests an OAuth2 bearer token at the start of each sync run, caching it until expiry approaches. On the Sage X3 side it accepts either the legacy HTTP Basic auth path (api1 with explicit enable required in nodelocal.js) or the modern OAuth2 + GraphQL path (Xtrem, V12+), determined at configuration. PayPal pushes payment and order events to a registered webhook endpoint, and ml-connector verifies the RSA-SHA256 signature on every event before processing. For each transaction, ml-connector queries Sage X3 to validate the target customer ID and GL account exist, then posts the payment or refund to the correct accounts receivable and GL entry records. Sage X3 access tokens expire in 5 minutes, so ml-connector refreshes them before each call. Payment amounts and dates are validated against PayPal's source to detect tampering. Every record is audited with the original PayPal transaction ID and timestamp.

A real-world example

A mid-sized e-commerce and wholesale distributor runs Sage X3 in the cloud for finance and inventory, and uses PayPal to accept customer payments online and via invoice links. Before the integration, the accounting team exported PayPal transaction reports weekly and manually entered each payment into Sage X3's cash receipts, mapping customer PO numbers to the correct Sage X3 customers. Refunds and chargebacks required manual reversal of the original receipt entry. With Sage X3 and PayPal connected, each customer payment appears in Sage X3's accounts receivable within seconds of PayPal settlement, pre-mapped to the customer and GL account, and refunds automatically reverse the original entry. Month-end AR reconciliation matches the Sage X3 GL to the PayPal settlement report without discrepancy, and the team's manual re-entry work is eliminated.

What you can do

  • Record PayPal customer payments and captures into Sage X3 accounts receivable and general ledger, mapped to the correct customer and GL account.
  • Automatically post PayPal refunds and chargebacks as reversals to the original Sage X3 sales transaction.
  • Reconcile PayPal settlement transactions to Sage X3 bank deposits and cash receipt records.
  • Validate PayPal customer metadata against Sage X3 customer IDs and GL accounts before posting to prevent posting to invalid dimensions.
  • Support both legacy HTTP Basic auth (REST api1) and modern OAuth2 (GraphQL Xtrem) Sage X3 connectivity depending on version and customer setup.

Questions

Does this integration work with both on-premise and cloud Sage X3 deployments?
Yes, it works with both. On-premise deployments use HTTP Basic auth via the legacy REST api1 endpoint, which requires explicit enablement by the customer admin in nodelocal.js. Cloud deployments can use either the legacy REST path or the modern OAuth2 + GraphQL (Xtrem) path depending on Sage X3 version (V12+). ml-connector detects the configured auth method at setup.
How are PayPal transactions matched to Sage X3 customers and GL accounts?
PayPal order records and payment metadata carry a reference field (such as invoice_id or custom_id) that stores the Sage X3 customer ID. When a payment is received, ml-connector looks up that Sage X3 customer ID, retrieves the default AR and revenue GL accounts configured for that customer, and posts the payment to those accounts. If the customer ID is invalid or missing, the transaction is flagged for manual review.
What happens if a PayPal refund or chargeback occurs after the original payment is posted to Sage X3?
ml-connector receives the PayPal refund or dispute event via webhook, queries Sage X3 for the original sales transaction using the PayPal transaction ID stored in the audit trail, and posts an offsetting reversal entry to zero out the original receipt and GL posting. The reversal entry is linked to the refund transaction ID for full traceability.

Related integrations

Connect Sage X3 and PayPal

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

Get started