API Documentation

Endpoints

Me

Identify the authenticated caller, its access level and its scopes. This is the ideal first call for any integration — an AI agent can use it to discover what it is allowed to do before attempting anything.

GET /wp-json/wcusage/v2/me

Permission: any authenticated user. No scope is needed for the identity fields; the cupones array requires read.

{
  "user": { "id": 1456, "display_name": "Sarah J", "login": "sarahj", "email": "[email protected]" },
  "is_admin": false,
  "is_affiliate": true,
  "auth": { "method": "api_key", "key_id": 3, "scopes": ["read"] },
  "coupons": [
    {
      "id": 8338,
      "code": "sarah10",
      "user_id": 1456,
      "date_created": "2023-05-02T10:11:12",
      "unpaid_commission": 40.46,
      "pending_order_commission": 0,
      "pending_payout_commission": 0
    }
  ],
  "api_version": "8.2.0"
}
CampoTypeDescripción
usuarioobjectid y display_name always; login y correo electrónico only when the caller is an admin or is that user.
is_adminbooleanWhether the caller passes the plugin's admin access check.
is_affiliatebooleanWhether the user has at least one affiliate coupon.
auth.methodstringapi_key o wordpress.
auth.key_idintegerThe API key's ID, or null.
auth.scopesarrayScopes in force, or null for capability-based auth (full access for that user).
cuponesarrayThe caller's own affiliate coupons with balances. Empty for non-affiliates.
api_versionstringThe installed Coupon Affiliates version.
Nota
auth.scopes: null means the request is no scope-limited — it authenticated with an application password or cookie, so the user's capabilities are the only limit.