REST API Reference
ThankRedirect registers two REST API endpoints used internally by the React-based settings interface. These endpoints are documented here for developers who need to interact with ThankRedirect programmatically or build integrations.
Authentication
All ThankRedirect endpoints require the user to be authenticated and have one of the following roles:
administratoreditorshop_manager
Requests must include a valid WordPress REST API nonce in the X-WP-Nonce header.
GET /wpkin-thankyou-page/v1/settings
Returns all current ThankRedirect settings along with the supporting data needed to render the settings interface.
Endpoint
GET /wp-json/wpkin-thankyou-page/v1/settings
Response
Returns a JSON object containing:
settings— All saved ThankRedirect settings with defaults appliedproducts— List of up to 500 products (id, name)categories— All product categoriestags— All product tagsproduct_types— Available WooCommerce product typesproduct_variations— Up to 200 product variationspages— Up to 500 WordPress pagesuser_roles— All registered WordPress user rolespayment_methods— All active WooCommerce payment gatewaysbrands— Product brands (if a supported brand plugin is installed)
Example Request
fetch('/wp-json/wpkin-thankyou-page/v1/settings', {
headers: {
'X-WP-Nonce': wpApiSettings.nonce
}
})
.then(response => response.json())
.then(data => console.log(data));
POST /wpkin-thankyou-page/v1/save-settings
Saves the ThankRedirect settings to the database.
Endpoint
POST /wp-json/wpkin-thankyou-page/v1/save-settings
Request Body
{
"settings": {
"global": {
"redirect_type": "page",
"page_id": 42
},
"product_redirects": [],
"category_redirects": []
}
}
Response
Returns true on success.
Notes
- All text values are sanitised with
sanitize_text_field()before saving - URLs are validated with
esc_url_raw() - Settings are stored in the
wpkin_thankyou_settingsWordPress option
Template Library Endpoints
ThankRedirect also registers REST endpoints for its template library (used by Elementor and Gutenberg integrations). These are publicly accessible:
| Endpoint | Description |
|---|---|
GET /wp-json/templatex/v1/templates | List all Elementor templates |
GET /wp-json/templatex/v1/templates/{id} | Get Elementor template data by ID |
GET /wp-json/templatex/v1/gutenberg-templates | List all Gutenberg templates |
GET /wp-json/templatex/v1/gutenberg-templates/{id} | Get Gutenberg template data by ID |
Note: The settings endpoints are intended for internal use by the ThankRedirect admin interface. While they can be used programmatically, the settings structure may change between plugin versions. Always test after updating the plugin if you rely on these endpoints directly.