주 콘텐츠로 건너뛰기
버전: 1.x

Role Endpoint Access

This page documents which WCPOS REST endpoints are accessible to each of the three default roles used in POS workflows:

  • administrator
  • shop_manager
  • cashier

For user-facing role and capability configuration, see Accessing the POS.

Summary

The default access model is:

  • administrator — full POS and management access.
  • shop_manager — full POS and management access, except plugin-extension actions that require plugin-install capabilities.
  • cashier — normal POS selling workflow access, but no management, settings, logs, or store-admin access.

The endpoint matrix is verified by integration tests that exercise the same authentication path as the POS app (WCPOS bearer access tokens, not just wp_set_current_user()). Allowed-endpoint assertions confirm a role does not receive 401 or 403. Some endpoints may still return normal data or business errors such as 400 or 404 when the test uses minimal fixtures — those responses still prove the user passed the auth/permission layer.

Free Plugin Endpoint Access Matrix

AreaEndpoint examplesAdminShop ManagerCashierNotes
Settings indexGET /wcpos/v1/settingsPublic/readable POS settings index
StoresGET /wcpos/v1/storesPOS boot data
Cashier profileGET /wcpos/v1/cashier/{id}Own cashier data
Cashier storesGET /wcpos/v1/cashier/{id}/storesStore access for current cashier
ProductsGET /wcpos/v1/productsCatalog browsing
VariationsGET /wcpos/v1/products/variationsCatalog browsing
CategoriesGET /wcpos/v1/products/categoriesCatalog filters
TagsGET /wcpos/v1/products/tagsCatalog filters
BrandsGET /wcpos/v1/products/brandsCatalog filters
CouponsGET /wcpos/v1/couponsPOS coupon lookup
Orders readGET /wcpos/v1/ordersPOS order history
Orders createPOST /wcpos/v1/ordersSelling workflow
Orders updatePATCH /wcpos/v1/orders/{id}Completing/updating POS orders
Checkout read/create/wcpos/v1/orders/{id}/checkoutPayment flow
ReceiptsGET /wcpos/v1/receipts/{order_id}Receipt rendering
Order statusesGET /wcpos/v1/data/order_statusesPOS status data
Customers readGET /wcpos/v1/customersCustomer search/list
Customers createPOST /wcpos/v1/customersCreate customer in POS
Customers updatePATCH /wcpos/v1/customers/{id}Edit customer in POS
TaxesGET /wcpos/v1/taxesCheckout/tax calculation data
Tax classesGET /wcpos/v1/taxes/classesCheckout/tax calculation data
Shipping methodsGET /wcpos/v1/shipping_methodsCheckout/shipping data
Payment gatewaysGET /wcpos/v1/payment-gatewaysPayment options
Gateway bootstrapPOST /wcpos/v1/payment-gateways/{id}/bootstrapPayment setup
TemplatesGET /wcpos/v1/templatesReceipt/template reads
Active templateGET /wcpos/v1/templates/activeReceipt/template reads
Template galleryGET /wcpos/v1/templates/galleryTemplate reads
General settingsGET /wcpos/v1/settings/generalManagement-only
Checkout settingsGET /wcpos/v1/settings/checkoutManagement-only
Tax ID settingsGET /wcpos/v1/settings/tax_idsManagement-only
Payment gateway settingsGET /wcpos/v1/settings/payment-gatewaysManagement-only
Extensions catalog/adminGET /wcpos/v1/extensionsManagement-only
LogsGET /wcpos/v1/logsManagement-only

Pro Plugin Endpoint Access Matrix

AreaEndpoint examplesAdminShop ManagerCashierNotes
Store edit dataGET /wcpos/v1/stores/{id}/editStore management
Store createPOST /wcpos/v1/storesStore management
Store updatePATCH /wcpos/v1/stores/{id}Store management
License settings updatePOST /wcpos/v1/settings/licensePro management
Extension actionsPOST /wcpos/v1/extensions/actionRequires plugin install/manage capability
Order refundsPOST /wcpos/v1/orders/{id}/refundsTreated as POS operation

Token Expiry Coverage

ScenarioAdminShop ManagerCashierExpected result
Valid access token✅ tested✅ tested✅ testedAllowed endpoints do not return 401 or 403
Expired access token✅ tested✅ tested✅ testedRequest fails at WCPOS auth gate with user 0
Valid refresh token after expired access✅ tested✅ tested✅ testedNew access token is issued and access is restored
Expired refresh token✅ tested✅ tested✅ testedCannot mint a new access token

Diagnosing Failures

If a default shop_manager sees an error like:

Request still unauthorized after token refresh - please log in again

The endpoint matrix indicates this is not because the default shop_manager role fundamentally lacks POS access. Likely causes to investigate:

  1. Site-specific role/capability corruption.
  2. An endpoint not covered by the matrix.
  3. Stale or expired access token retry behaviour in the client.
  4. Third-party security or authentication plugin interference.
  5. Pro or store-specific access rules, or custom code.

Permission failure vs. token failure

The POS frontend may display the same token-refresh error for both cases after it receives a 401 or 403, attempts a token refresh, and the retry is still unauthorised. The two failure modes look different on the server side:

A real role/capability failure usually looks like:

status: 403
current_user: <actual user id>
access token expired: false

A token/auth failure usually looks like:

status: 403
current_user: 0
access token expired: true or invalid

Use this distinction when triaging POS access issues — a non-zero current_user points at capabilities, while current_user: 0 points at the auth/token layer.