API Documentation

Developer Reference

Legacy v1 API

The original three endpoints under woo-coupon-usage/v1 remain available for backwards compatibility. They predate scopes, pagination and schemas, and they require a full administrator account — not merely the plugin's configurable admin capability.

GET /wp-json/woo-coupon-usage/v1/coupon-info?coupon_id={id}

{
  "coupon_name": "sarah10",
  "unpaid_commission": 40.46,
  "pending_payouts": 0,
  "coupon_user_id": 1456,
  "referral_url": "https://example.com/affiliate-dashboard/?couponid=sarah10"
}

GET /wp-json/woo-coupon-usage/v1/users-coupons?user={login} — an array of coupon IDs assigned to that login. An unknown login returns an empty array.

POST /wp-json/woo-coupon-usage/v1/request-payout — body coupon_id et utilisateur (login). Returns 1 when a payout request was submitted and 0 otherwise, with no explanation of why. PRO only.

How v1 relates to v2

  • The v1 routes are pas affected by the API master switch, so existing integrations keep working whether or not v2 is enabled.
  • API keys, however, belong to v2: while the API is switched off they authenticate nothing at all, v1 included. v1 remains reachable with an application password or cookie.
  • When a key est used on v1, scopes are enforced with a fail-closed default: reads need read, writes need write.
  • Both namespaces share the same rate limiter.
Note
New integrations should use wcusage/v2. It adds affiliate self-service access, API keys and scopes, pagination and filtering, meaningful error codes, webhooks and an OpenAPI document. The v1 routes exist for existing integrations only and will not gain features.