API Documentation

Endpoints

Anmeldungen

Read and moderate affiliate applications. These endpoints read the plugin's registration table, and approval goes through the same function the admin screen calls, so the full accept flow runs identically.

List registrations

GET /wp-json/wcusage/v2/registrations

Permission: admin, read scope.

ParamTypeBeschreibung
statusstringpending, accepted oder declined.
user_idintegerFilter by WordPress user.
page / per_pageintegerStandard pagination.
{
  "id": 512,
  "user": { "id": 2201, "display_name": "New Affiliate", "login": "newaffiliate", "email": "[email protected]" },
  "coupon_code": "newaff15",
  "status": "pending",
  "type": "",
  "promote": "Instagram and my newsletter",
  "referrer": "",
  "website": "https://blog.example.net",
  "custom_fields": { "Audience size": "12000" },
  "date": "2026-08-05T18:22:41",
  "date_accepted": null
}

custom_fields holds whatever extra registration fields the store has configured, as a flat object. It is an empty object when there are none.

Get one registration

GET /wp-json/wcusage/v2/registrations/{id}

Permission: admin, read scope.

Approve or decline

POST /wp-json/wcusage/v2/registrations/{id}/status

Permission: admin, write scope.

Body paramTypeBeschreibung
statusstringRequired. accepted oder declined.
messagestringOptional message included in the notification email.
send_emailbooleanWhether to send the notification email. Default wahr.

Returns the updated registration.

Warning
Accepting runs the full approval flow: the affiliate coupon is created from the template, roles are assigned, emails are sent and hooks fire — exactly as if approved from the admin screen.
Error codeCondition
no_change (400)The registration already has that status.
already_accepted (400)The registration was already accepted. Accepting is not reversible through the API, because an accept → decline → accept cycle would create a second published coupon with the same code and its own separate balance. Reverse it from the admin screens if you really must.
no_coupon_code (409)The registration carries no coupon code, so its status cannot be changed. Add one from the admin screens first.
not_updated (409)Something on the site refused the change. The response reports what the row actually says rather than what was asked for.
unavailable (501)The registrations table does not exist on this install.