REST API

Advanced Coupons creates it own namespace and endpoints by extending the default WordPress REST APIarrow-up-right.

Namespaces

coupons/v1chevron-rightloyalty-program/v1chevron-rightwc-store-credits/v1chevron-right

Authentication

The plugin uses WordPress REST API cookie authenticationarrow-up-right 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 capabilitiesarrow-up-right. 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_inarrow-up-right 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