API Documentation

Endpoints

Rapports

A store-wide program summary, built for dashboards and AI assistants that need the whole picture in one call.

GET /wp-json/wcusage/v2/reports/summary

Permission: admin, read scope.

ParamTypeDescription
topintegerHow many top affiliates to include, by all-time commission. 0–50, default 10.
refreshbooleanBypass the 5-minute report cache. Default faux.
{
  "generated": "2026-08-07T14:05:00",
  "currency": "USD",
  "totals": {
    "affiliates": 448,
    "coupons": 512,
    "orders_count": 10231,
    "total_sales": 812337.20,
    "total_discount": 79110.55,
    "total_commission": 81233.71,
    "unpaid_commission": 6120.44,
    "pending_payout_commission": 1240.00
  },
  "payouts": { "pending_count": 12, "pending_amount": 1240.00, "paid_count": 981, "paid_amount": 73873.27 },
  "pending_registrations": 7,
  "top_affiliates": [
    { "user_id": 1456, "orders_count": 19, "total_sales": 1977.80, "total_commission": 181.60,
      "user": { "id": 1456, "display_name": "Sarah J", "login": "sarahj", "email": "[email protected]" } }
  ],
  "cached": false
}

cached: true means the response came from the 5-minute cache. The paiements block is present only when the payouts add-on is available — the free build omits it entirely rather than reporting four zeros as though the program had simply never paid anybody.

Note
Totals are summed from the same stored per-coupon snapshots the affiliate dashboards show, so they move when those snapshots are rebuilt rather than order by order. Balances (commission_non_rémunérée, pending_payout_commission) are always current.