API Documentation

Developer Reference

Error Reference

All codes are prefixed wcusage_api_ in the response. Core WordPress codes such as rest_no_route, rest_invalid_param and rest_missing_callback_param can also appear.

CodeStatusMeaning
unauthorized401No authenticated user. Send an application password or an API key.
forbidden403Authenticated, but this user may not access the resource.
invalid_key401The API key is unknown, revoked or expired.
invalid_key_user401The user the key acts as no longer exists.
https_required401API keys may only be used over HTTPS.
too_many_auth_failures429Too many invalid keys from this address; wait for the window to roll over.
insufficient_scope403The key lacks the scope this route needs.
key_wrong_namespace403An API key was presented to an endpoint outside the plugin's namespaces.
rate_limited429Per-minute request limit exceeded. See retry_after.
throttled429An expensive recalculation was requested again too soon. See retry_after.
not_found404No such resource — or it belongs to somebody else.
unavailable501The feature or table this endpoint reads is not present on this install.
log_disabled400The activity log is switched off, so the events feed is empty.
coupon_required400Non-admin callers must pass a coupon_id to /clicks/stats.
no_change400The payout or registration already has the requested status.
already_accepted400The registration was already accepted; reversal is admin-only.
no_coupon_code409The registration has no coupon code, so its status cannot change.
not_updated409Something on the site refused the registration status change.
payouts_disabled400Payout requests are switched off in the plugin settings.
requests_disabled403Affiliates cannot self-request payouts on this store.
no_affiliate400The coupon has no affiliate assigned.
no_balance400There is no unpaid commission to request.
below_threshold400The unpaid balance is under the store's minimum payout threshold.
no_payout_details400The affiliate has not saved payout details.
method_disabled400The saved payout method is no longer enabled on the store.
invoice_required400This payout method requires an invoice upload; use the affiliate dashboard.
in_progress409A payout request for this coupon is already being processed.
not_created409The payout request was refused by a filter or a failed write.
invalid_transition400That payout status change is not permitted through the API.
insufficient_unpaid409A cancelled payout cannot be re-opened; its amount is no longer in the unpaid balance.
conflict409The payout status changed while this request was in flight.
cannot_create_for_user403You may not create an API key acting as that user.
cannot_manage_key403You may not revoke that user's API key.
invalid_user400The user for this API key does not exist.
invalid_expiry400The expiry date is not in Y-m-d format.
invalid_url400The webhook URL is invalid or points at a disallowed host.
no_events400No valid webhook events were supplied.
no_fields400A webhook update supplied nothing to change.
delivery_failed502A test delivery could not reach the endpoint.
no_entropy500The server could not generate a secure token or secret.
db_error500The API key could not be saved.