Launch Sale — 20% off all plugins. Limited time only.

Abilities API

On WordPress 6.9 and later, Refinery CRM automatically registers abilities with the WordPress Abilities API. These abilities allow AI agents, automation tools, and the WordPress MCP Adapter to interact with CRM data programmatically — querying customers, managing segments, viewing analytics, and sending emails.

Prerequisites

  • WordPress 6.9 or later — The Abilities API was introduced in WordPress 6.9. On earlier versions, abilities are not registered and the plugin functions normally.
  • WooCommerce — Must be installed and active.
  • manage_woocommerce capability — All abilities require store management permissions.

Registered abilities

Refinery CRM registers the following abilities in the refinery-crm category. All abilities are exposed through the REST API with show_in_rest enabled.

Ability Description Type
refinery-crm/list-customers Retrieve a paginated list of customers with order stats. Accepts search, pagination, and sort parameters. Read
refinery-crm/get-customer Retrieve a single customer profile with billing address, order count, and lifetime value. Read
refinery-crm/send-email Send an email to a customer using WooCommerce email templates. Requires email, name, subject, and message. Write
refinery-crm/list-segments Retrieve all customer segments with customer counts. Read
refinery-crm/create-segment Create a new customer segment with filter rules. Requires a name and rules array. Write
refinery-crm/get-analytics Retrieve store analytics with period comparison. Accepts date range and comparison type. Read

How it works

Abilities are registered on the wp_abilities_api_init action hook when WordPress initializes the Abilities Registry. Each ability defines:

  • Input schema — A JSON Schema describing accepted parameters
  • Output schema — A JSON Schema describing the response structure
  • Execute callback — The function that performs the operation
  • Permission callback — Checks that the caller has manage_woocommerce capability

Abilities can be invoked through the WordPress REST API, the WordPress MCP Adapter, or programmatically via WP_Abilities_Registry::get_instance().

Using with the MCP Adapter

Install the WordPress MCP Adapter plugin to expose registered abilities to AI agents that support the Model Context Protocol (MCP). Once installed, any AI agent connected via MCP can discover and invoke CRM abilities — listing customers, querying segments, and sending emails — all with proper permission checks.

Backward compatibility

The Abilities API registration is guarded behind a function_exists('wp_register_ability') check. On WordPress versions earlier than 6.9, the abilities are not registered and the plugin continues to function normally. No code changes or configuration are needed.

Grow Your Store Smarter

One email a week with plugin updates, revenue tactics, and strategies top WooCommerce stores use to scale.

By subscribing, you agree to our Privacy Policy. Unsubscribe anytime.

Item added to cart.
0 items - $0.00