API Documentation

Endpoints

Clicks

Aggregated referral-link click statistics, counted in SQL rather than loaded row by row.

GET /wp-json/wcusage/v2/clicks/stats

Permission: admin for store-wide figures; affiliates must pass a cupón_id they own. read scope.

ParamTypeDescripción
cupón_idintegerLimit to one coupon. Required for non-admin users — omitting it returns 400 wcusage_api_coupon_required.
campaignstringFilter by campaign name (exact match).
from / todateOptional date range.
{
  "coupon_id": 8338,
  "campaign": null,
  "from": "2026-07-01",
  "to": "2026-07-31",
  "clicks": 412,
  "conversions": 19,
  "conversion_rate": 4.61
}

conversion_rate is a percentage rounded to two decimals, and is 0 when there were no clicks.

Nota
The IP addresses stored with clicks are never exposed through the API. If the clicks table does not exist on the install, the endpoint answers 501 wcusage_api_unavailable.