Skip to main content

Settings API

The Settings controller (api/settings.php, base settings) reads store settings and updates payment gateway configuration. It extends WP_REST_Controller directly (not the StoreEngine base controller).

Authentication

Admin only — Helper::check_rest_user_cap( 'manage_options' ). See Authentication.

Routes

MethodPathPurpose
GET/settingsRead store settings
PUT/PATCH/settings/payment-gatewaysUpdate gateway config
PUT/PATCH/settings/verify-payment-gatewaysVerify gateway credentials

All paths are relative to /wp-json/storeengine/v1.

GET /settings

GET /wp-json/storeengine/v1/settings

Returns the store settings object (store identity, currency, pages, checkout options, and so on).

curl https://your-store.example/wp-json/storeengine/v1/settings \
-u "admin:APPLICATION_PASSWORD"

PUT/PATCH /settings/payment-gateways

PUT /wp-json/storeengine/v1/settings/payment-gateways

Updates payment gateway settings. Each gateway declares its own fields (text, password, checkbox, safe-text, etc.), and the endpoint validates and sanitizes each field against that declared type.

ParamTypeRequiredNotes
configobjectyesGateway settings keyed by field.
contextstringnoSanitization context; default edit.
curl -X PUT https://your-store.example/wp-json/storeengine/v1/settings/payment-gateways \
-u "admin:APPLICATION_PASSWORD" \
-H "Content-Type: application/json" \
-d '{
"config": {
"stripe": { "is_production": true, "publishable_key": "pk_live_…", "secret_key": "sk_live_…" }
}
}'

The precise config schema is generated from the registered gateways; inspect it with an OPTIONS request against the route.

PUT/PATCH /settings/verify-payment-gateways

PUT /wp-json/storeengine/v1/settings/verify-payment-gateways

Verifies a gateway's credentials without persisting them — the "Test connection" action.

ParamTypeRequiredNotes
methodstringyesGateway id to verify (e.g. stripe).
configobjectyesThe credentials to test.
contextstringnoDefault edit.
curl -X PUT https://your-store.example/wp-json/storeengine/v1/settings/verify-payment-gateways \
-u "admin:APPLICATION_PASSWORD" \
-H "Content-Type: application/json" \
-d '{ "method": "stripe", "config": { "secret_key": "sk_test_…" } }'