API Documentation

Getting Started

Endpoint Index

Every route in the API, with the access level and scope it needs. All paths are relative to https://example.com/wp-json/wcusage/v2.

Method & pathAccessScopePurpose
GET /meAny logged-in userIdentify the caller, its access level and scopes.
GET /affiliatesAdminreadList affiliates with coupons and balances.
GET /affiliates/{id}Admin or selfreadOne affiliate, with profile fields and groups.
GET /affiliates/{id}/statsAdmin or selfreadTotals across all of an affiliate's coupons.
GET /couponsAdminreadList affiliate coupons.
GET /coupons/{id}Admin, owner, uplinereadOne coupon, with commission rates and referral URL.
GET /coupons/{id}/statsAdmin, owner, uplineread (+write to refresh)Sales and commission, all-time or by date range.
GET /coupons/{id}/ordersAdmin, owner, uplinereadOrders referred by a coupon, with commission per order.
GET /payoutsAny logged-in userreadList payouts. Non-admins see only their own.
POST /payoutsAdmin or coupon ownerwriteRequest a payout for a coupon's unpaid balance.
GET /payouts/{id}Admin or ownerreadOne payout.
POST /payouts/{id}/statusAdminwriteChange a payout status. Bookkeeping only.
GET /registrationsAdminreadList affiliate applications.
GET /registrations/{id}AdminreadOne application.
POST /registrations/{id}/statusAdminwriteApprove or decline an application.
GET /clicks/statsAdmin, or owner with coupon_idreadClicks, conversions and conversion rate.
GET /eventsAdminreadChange feed with a cursor for polling.
GET /reports/summaryAdminreadStore-wide totals and top affiliates.
GET /keysAdminmanageList API keys.
POST /keysAdminmanageCreate an API key.
DELETE /keys/{id}AdminmanageRevoke an API key.
GET /webhooksAdminmanagePRO. List webhook endpoints.
POST /webhooksAdminmanagePRO. Create a webhook endpoint.
PATCH /webhooks/{id}AdminmanagePRO. Change status or subscribed events.
DELETE /webhooks/{id}AdminmanagePRO. Delete a webhook endpoint.
POST /webhooks/{id}/testAdminmanagePRO. Send a test delivery.
GET /webhooks/eventsAdminreadPRO. The catalog of subscribable events.
GET /openapiPublic by defaultMachine-readable description of this API.

"Owner" means the affiliate the coupon is assigned to; "upline" means their multi-level parent, which exists in PRO only. Payout and webhook routes are PRO only. Every endpoint can additionally be switched off per site — see Enabling the API.