API & Webhooks
Updated agosto 26, 2026
REST API
Coupon Affiliates has a comprehensive REST API, so your affiliate data no longer has to live only inside WordPress. You can pull statistics into an external dashboard, sync affiliates and referrals with another system, wire your program into an automation tool, or point an AI assistant at it and ask it questions about your affiliates.
You will find it under Coupon Affiliates > Admin Tools > API. The API stays switched off until you enable it, and individual endpoints can be turned on and off from the same page, so nothing is exposed that you have not deliberately allowed.
The current namespace is wcusage/v2. With pretty permalinks, the base URL is:
https://yoursite.com/wp-json/wcusage/v2
Pretty permalinks are required for the /wp-json/ URL. On a site with plain permalinks, use https://yoursite.com/?rest_route=/wcusage/v2/me instead. API keys will not authenticate against /wp-json/ on a plain-permalinks site.
HTTPS is required for API keys, except on local and development environments.
In short:
- Endpoints for affiliates, coupons, referred orders, clicks, registrations, reports, payouts, activity events, and a “me” endpoint that an affiliate’s own integration can call.
- API keys with scopes. Create a key, choose whether it can read, write, or manage the API itself, give it an optional expiry date, and revoke it at any time. WordPress application passwords work too.
- Permissions are inherited. A key acts as a specific user, so administrators can read everything, while a key issued for an affiliate only ever sees that affiliate’s own coupons, statistics and payouts.
- An OpenAPI document is generated for your own site (for example
GET /wp-json/wcusage/v2/openapi), so tools that understand OpenAPI (including most AI assistants) can discover the endpoints themselves.
The API is included in the free version. Payouts endpoints and outbound webhooks are PRO. On the free version, poll GET /events instead of using webhooks. That endpoint needs the activity log switched on.
This page covers enabling the API, keys, and webhooks in wp-admin. The full endpoint reference, authentication details, request examples and webhook payloads are in the developer documentation:
Webhooks
Rather than polling the API for changes, PRO users can have your site tell another service the moment something happens.
Add a webhook, choose which events it should receive, and a signed JSON payload is sent to your URL whenever one of them fires: a referral being attributed, commission being added or removed, a registration being submitted, approved or declined, and payouts being requested, paid, cancelled or reversed. Events are also available for an affiliate being created or updating their payout details, a performance bonus being earned, a campaign being created, and a direct link tracking domain being added. Multi-level commission, invite and sub-affiliate registration events are included as well.
Every delivery is signed with HMAC-SHA256 so the receiving end can verify it really came from your store, failed deliveries are retried with a backoff, and there is a “Send test” button to check your endpoint before you rely on it.
You can still add and test webhooks in wp-admin while the API is off. Turning the API off stops webhook deliveries (already-queued retries are dropped). If another system depends on webhooks, leave the API enabled.
On the free version, poll GET /wp-json/wcusage/v2/events instead. The activity log must be on, or that endpoint returns an error.