API Documentation

Endpoints

Events

A cursor-based change feed over the plugin's activity log. This is the polling counterpart to webhooks: ask "what happened since event X" and act on the answer. Webhooks are PRO, so on the free version this endpoint is how you keep an external system in step.

GET /wp-json/wcusage/v2/events

Permission: admin, read scope.

ParamTypeDescription
afterintegerCursor. Returns only events with a higher ID, oldest first. Without it, newest first.
eventstringFilter by event type.
user_idintegerFilter by the acting user.
page / per_pageintegerStandard pagination. page is ignored in cursor mode.
[
  { "id": 9911, "event": "payout_paid", "event_id": 321, "user_id": 1, "info": "40.46", "date": "2026-08-07T10:15:00" },
  { "id": 9912, "event": "referral", "event_id": 8355, "user_id": 0, "info": "sarah10", "date": "2026-08-07T10:16:31" }
]

The response header X-WCUsage-Last-Event carries the highest event ID returned. Store it and pass it as after on the next poll:

GET /wp-json/wcusage/v2/events?after=9912&per_page=100
→ X-WCUsage-Last-Event: 9987

Event types

Événementevent_id refers to
referralOrder
commission_added, commission_removedCoupon
mla_commission_added, mla_commission_removedCoupon (PRO)
registration, registration_acceptRegistration
payout_request, payout_paid, payout_reversed, payout_cancelledPayout (PRO)
reward_earnedReward (PRO)
new_campaignCampaign (PRO)
direct_link_domainDirect link (PRO)
mla_inviteInvite (PRO)
lifetime_link_editedCustomer (PRO)
api_key_created, api_key_revokedAPI key

user_id is the acting user, and is 0 for system and guest actions such as a referral from a logged-out shopper. info is free-form context whose meaning depends on the event type.

Note
Declined registrations are pas written to the activity log, so they never appear in this feed. Subscribe to the registration.declined webhook (PRO) if you need them.
Warning
The feed needs the journal d'activité enabled in the plugin settings (it is by default). When it is off, this endpoint answers 400 wcusage_api_log_disabled. Webhooks are unaffected — they fire from the same funnel, before the log setting is consulted.