REST API

Advanced Coupons creates it own namespace and endpoints by extending the default WordPress REST API.

Namespaces

coupons/v1loyalty-program/v1wc-store-credits/v1

Authentication

The plugin uses WordPress REST API cookie authentication in the admin app.

For remote applications (e.g Postman), you will need to authenticate using either of the following options:

Permissions

Permissions are managed via WordPress user roles and capabilities. Each endpoint and its respective method varies depending of the use case of said endpoint.

For endpoints which purpose is for the admin side may only be accessed by user roles that has the manage_woocommerce user capability. (Administrator, Shop Manager, etc.)

For endpoints which contains private data for the current user, it will at least require the user to have an authenticated logged in status. This is checked via is_user_logged_in function.

For endpoints that will need to be used globally (settings) will not require any authentication for reads, but will need to have the manage_woocommerce user capability for doing create, update and delete actions.

Last updated