1. Home
  2. Knowledge Base
  3. Loyalty Program
  4. How to Use WordPress Abilities API with Loyalty Program

How to Use WordPress Abilities API with Loyalty Program

If you use an AI assistant or automation tool that speaks the WordPress Abilities API, the Loyalty Program for WooCommerce exposes its loyalty data and actions as abilities those tools can call. This article explains what abilities are available, who can use them, and how to turn them off.

What the Abilities API gives you

The WordPress Abilities API is a standard way for plugins to publish named capabilities that AI tools and other software can discover and call. Loyalty Program registers 14 abilities under the shared advanced-coupons namespace, so they sit alongside the abilities from Advanced Coupons itself. See How to use the WordPress Abilities API with Advanced Coupons for the shared setup.

Before you start

  • WordPress with the Abilities API available, either included in your version of WordPress or added through the Abilities API feature plugin. Loyalty Program registers its abilities on the Abilities API init hook, so they appear only when the API is present.
  • Loyalty Program for WooCommerce version 1.9.3 or later.
  • A logged-in user with the manage_woocommerce capability. Every loyalty ability checks this permission, so shop managers and administrators can use them.

Read abilities

These abilities return loyalty data without changing anything, useful for reporting and answering questions.

AbilityWhat it does
advanced-coupons/get-loyalty-balanceGet Loyalty Points Balance
advanced-coupons/list-top-loyalty-customersList Top Loyalty Customers
advanced-coupons/get-loyalty-points-ledgerGet Loyalty Points Ledger
advanced-coupons/list-loyalty-earn-rulesList Loyalty Earn Rules
advanced-coupons/get-loyalty-redemption-settingsGet Loyalty Redemption Settings
advanced-coupons/get-loyalty-program-overviewGet Loyalty Program Overview
advanced-coupons/get-loyalty-roi-reportGet Loyalty ROI Report
advanced-coupons/get-expiring-loyalty-pointsGet Expiring Loyalty Points

Action abilities

These abilities change loyalty data, so treat them with the same care as any admin action.

AbilityWhat it does
advanced-coupons/adjust-loyalty-pointsAdjust Loyalty Points
advanced-coupons/create-loyalty-earn-ruleCreate Loyalty Earn Rule
advanced-coupons/update-loyalty-earn-ruleUpdate Loyalty Earn Rule
advanced-coupons/toggle-loyalty-earn-ruleToggle Loyalty Earn Rule
advanced-coupons/update-loyalty-redemption-settingsUpdate Loyalty Redemption Settings
advanced-coupons/issue-loyalty-bonus-pointsIssue Loyalty Bonus Points

Permissions

Every loyalty ability runs a permission check for the manage_woocommerce capability. A request from a user without that capability is refused, so customers and lower-privilege roles cannot read or change loyalty data through the API.

How to disable the abilities

If you would rather not expose these abilities, you can switch them off in two ways.

  1. Define the LPFW_DISABLE_ABILITIES constant as true in your wp-config.php (or a small custom plugin). When set, Loyalty Program skips registering its abilities entirely.
  2. Or return true from the lpfw_disable_abilities filter if you prefer to control it in code.

Either method stops all 14 loyalty abilities from registering. Abilities from other Advanced Coupons plugins are unaffected.

Frequently Asked Questions

Do customers have access to these abilities?

No. Every ability requires the manage_woocommerce capability, so only shop managers and administrators can use them.

Why are they under the advanced-coupons namespace and not a loyalty one?

Advanced Coupons and its add-ons share a single namespace so an AI tool sees one consistent set of abilities across the suite. The loyalty abilities are named with a loyalty descriptor so they are easy to identify.

Need Help?

If you have a question or run into any issues, we’re here to help.

Was this article helpful?

Related Articles

Complete Your Purchase