ml-connector
PlexGoCardless

Plex and GoCardless integration

Plex runs manufacturing and finance. GoCardless runs AR collections via bank debit. Connecting the two keeps customer payment records in agreement and automates the flow of AR invoices from Plex into GoCardless collections mandates. When a sales order ships and invoices in Plex, the customer and invoice amount flow into GoCardless to initiate collection, and payment status updates from GoCardless feed back into Plex for cash application and reconciliation. ml-connector handles the authentication differences and manages the polling cadence since Plex offers no native webhooks.

How Plex works

Plex exposes customers, sales orders, invoices, GL accounts, and payments through REST APIs at https://cloud.plex.com/api, authenticated with OAuth2 client credentials. The cloud platform requires no Idempotency-Key header support, so ml-connector uses unique external reference fields to detect duplicates. Plex has no native webhooks for AR records, so customers, invoices, and payments are read by polling on a configurable interval rather than receiving a push. Role-based permissions are enforced on the integration user, so the Plex account must have the correct AR and sales data access roles assigned or API calls return 403 or empty results.

How GoCardless works

GoCardless exposes customers, customer bank accounts, mandates, payments, subscriptions, and payouts through REST APIs at https://api.gocardless.com, authenticated with a bearer access token from the merchant dashboard. Every webhook must include HMAC-SHA256 signature verification, and a 2xx response should only be returned on a valid signature, or GoCardless marks the endpoint healthy and stops retrying. Payouts are read-only and created automatically by GoCardless, so ml-connector never writes payouts back. Amount fields are integers in the smallest currency unit (pence or cents), and webhook events include an audit trail of all changes.

What moves between them

Customer and payment data flows from Plex into GoCardless. When a sales order invoices in Plex, ml-connector reads the customer and invoice amount, creates a customer record in GoCardless if it does not exist, adds or updates the customer bank account, and creates a mandate for recurring collections or a one-off payment request via the Plex invoice amount. Payment status changes (collected, failed, refunded) flow from GoCardless back into Plex via webhook events, where they update the payment status field in the AR module. This allows Plex to reconcile cash receipts and identify failed collections for follow-up.

How ml-connector handles it

ml-connector polls Plex customers and invoices on a schedule tied to your sales and invoicing cycle (typically 1-4 hours), using the modified_date filter to fetch only new and changed records since the last poll. For each customer, it checks GoCardless for an existing customer record with a matching external reference; if not found, it creates one. It then fetches or creates the customer bank account in GoCardless (bank account details must be captured in Plex or entered via a pre-sync mapping). OAuth tokens for Plex are refreshed on expiry by calling the token endpoint. GoCardless webhooks notify ml-connector of payment state changes (paid, failed, refunded), which are mapped back into Plex payment status. Amount conversion is handled automatically: Plex stores amounts as decimals, while GoCardless expects integers in the smallest currency unit, so ml-connector multiplies by 100 before sending and divides on receipt. Webhook signatures are verified using the GoCardless secret, and only valid signatures are processed.

A real-world example

A mid-sized discrete manufacturer uses Plex for ERP and AR management across two regions. The finance team manually exports customer invoices from Plex, enters them into a separate AR collection spreadsheet, and tracks collections via bank statements, spending time on duplicate data entry and late-payment follow-up. With Plex and GoCardless connected, each new invoice from Plex automatically creates a payment mandate in GoCardless for that customer's bank account. Collections flow back into Plex as webhook events, where payment status updates automatically so the finance team can see at a glance which invoices are paid, pending, or failed. The manual AR export-and-rekey step disappears, and cash application is nearly automated.

What you can do

  • Read Plex customers and AR invoices via polling and create or update matching customer records and bank account details in GoCardless.
  • Create payment mandates and subscription records in GoCardless for each Plex invoice to initiate bank debit collections.
  • Receive GoCardless webhook events for payment state changes and update Plex payment status so cash application is reflected in the ledger.
  • Handle OAuth token refresh for Plex and HMAC-SHA256 signature verification for GoCardless webhooks.
  • Convert amount fields from Plex decimal format to GoCardless integer format (smallest currency unit) and back.

Questions

Which direction does data move between Plex and GoCardless?
Customers and invoices flow from Plex into GoCardless, where payment mandates are created to initiate collections. Payment state changes (collected, failed, refunded) flow from GoCardless back into Plex via webhooks, updating the payment status field in AR. This is a bidirectional sync, but data originates in Plex and flows outbound to GoCardless for collections.
How does ml-connector handle Plex's lack of native webhooks?
ml-connector polls Plex customers and invoices on a configurable schedule (typically 1-4 hours), using the modified_date filter to fetch only new and changed records since the last poll. This approach is recommended for AR workflows that do not require real-time updates. GoCardless webhooks are used for inbound payment state changes, so ml-connector receives collections updates in near real-time.
How does ml-connector convert amounts between Plex and GoCardless?
Plex stores amounts as decimal numbers, while GoCardless expects integers in the smallest currency unit (pence or cents). ml-connector multiplies Plex amounts by 100 before sending them to GoCardless and divides GoCardless amounts by 100 when writing them back to Plex, ensuring accurate currency conversion across the two systems.

Related integrations

Connect Plex and GoCardless

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

Get started