Integrate Perfex CRM with WordPress or Any CMS

Why Connect CRM to Your Website?

Your WordPress site shows marketing content. Your Perfex CRM holds real business data: clients, invoices, project status, task progress. Connecting them means your website can display live data without manual updates.

How the Integration Works

Data Builder exposes Perfex CRM tables through REST API endpoints. Your WordPress site calls these endpoints via JavaScript fetch() or PHP wp_remote_get() to retrieve and display data.

// JavaScript: Fetch latest clients from Perfex CRM
const response = await fetch('https://databuilder.polyxgo.com/api/v1/clients?per_page=5&sort=-id', {
  headers: { 'Authorization': 'Bearer YOUR_TOKEN' }
});
const data = await response.json();
data.data.forEach(client => {
  console.log(client.company, client.phonenumber);
});

Common Integration Patterns

  • Client portal – Display project status and invoice history to logged-in clients
  • Embedded reports – Show public chart reports via iframe on dashboard pages
  • Contact forms – Create CRM leads directly via POST /api/v1/leads
  • Live metrics – Display real-time KPIs using filtered API queries

Authentication for Websites

Create a dedicated API token with read-only scope for your website. Use domain whitelisting to restrict API access to your WordPress domain only:

  • Token scope: tables (read-only)
  • Allowed tables: only the tables your site needs
  • Domain whitelist: yoursite.com

For write operations (form submissions), create a separate token with write scope limited to specific tables.

GraphQL for Complex Pages

If your page needs data from multiple CRM tables (clients + invoices + projects), use GraphQL to fetch everything in a single request:

// Single request: clients with their latest invoices
const query = `{
  clients(limit: 10) { userid company }
  invoices(limit: 5, sort: "-id") { id total status }
}`;
const response = await fetch('https://databuilder.polyxgo.com/api/v1/graphql', {
  method: 'POST',
  headers: { 'Authorization': 'Bearer TOKEN', 'Content-Type': 'application/json' },
  body: JSON.stringify({ query })
});

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *