Search here to get answers to your questions.

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:

  • administrator
  • editor
  • shop_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 applied
  • products — List of up to 500 products (id, name)
  • categories — All product categories
  • tags — All product tags
  • product_types — Available WooCommerce product types
  • product_variations — Up to 200 product variations
  • pages — Up to 500 WordPress pages
  • user_roles — All registered WordPress user roles
  • payment_methods — All active WooCommerce payment gateways
  • brands — 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_settings WordPress 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/templatesList all Elementor templates
GET /wp-json/templatex/v1/templates/{id}Get Elementor template data by ID
GET /wp-json/templatex/v1/gutenberg-templatesList 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.
Last Updated: March 23, 2026